diff --git a/Makefile b/Makefile index 93301d2b..f2c54d42 100644 --- a/Makefile +++ b/Makefile @@ -565,7 +565,14 @@ define NEW_APPLE_CMAKE_BUILD # Setup cmake $4/$(CMAKE_CACHE): DEP_SOURCE_DIR := $(DEPS_MODULES_DIR)/$3 $4/$(CMAKE_CACHE): DEP_BUILD_DIR := $4 -$4/$(CMAKE_CACHE): CFLAGS := -Wall -arch arm64 + +# Conditionally set CFLAGS if $2 equals LIBJPEG_TURBO and BUILD_PLATFORM_ARCH equals arm64 +ifeq ($2, LIBJPEG_TURBO) +ifeq ($(BUILD_PLATFORM_ARCH), arm64) +$4/$(CMAKE_CACHE): CFLAGS := -arch arm64 +endif +endif + $4/$(CMAKE_CACHE): DEP_ARTIFACTS_DIR := $$($1_DEPS_ARTIFACTS_DIR) $4/$(CMAKE_CACHE): CMAKE_BUILD_SETTINGS := -GXcode -DCMAKE_MACOSX_BUNDLE=NO $4/$(CMAKE_CACHE): PLATFORM := -DPLATFORM=$$($1_ARCH) @@ -574,7 +581,7 @@ $4/$(CMAKE_CACHE): $$(SETUP_CMAKE) # Build -$(call CLEAN_LIBGJPEG) +# $(call CLEAN_LIBGJPEG) $$($1_DEPS_LIB_DIR)/$5: CMAKE_BUILD_DIR := $4 $$($1_DEPS_LIB_DIR)/$5: CMAKE_BUILD_OPTIONS := $(if $(filter $($1_SUBSYSTEM),$(APPLE_IOS)),CODE_SIGNING_ALLOWED=NO,) $$($1_DEPS_LIB_DIR)/$5: $4/$(CMAKE_CACHE)