From d80e91e5895ea419829b116daf23a3a2e45aac4a Mon Sep 17 00:00:00 2001 From: samuelOsborne Date: Wed, 4 Dec 2024 10:39:03 +0100 Subject: [PATCH] fix: zlib renaming worked, fixing jpeg arch symbols - Added CMAKE_C_FLAGS --- Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 46c13e03..feb78323 100644 --- a/Makefile +++ b/Makefile @@ -121,6 +121,7 @@ NINJA_BUILD_FILE := build.ninja THORVG_LIB := libthorvg.a CMAKE_TOOLCHAIN_FILE := toolchain.cmake +CMAKE_C_FLAGS := "" CMAKE_MAKEFILE := Makefile CMAKE_CACHE := CMakeCache.txt @@ -346,7 +347,7 @@ endef define SETUP_CMAKE cmake -DCMAKE_INSTALL_PREFIX=$(DEP_ARTIFACTS_DIR) \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DCMAKE_C_FLAGS="-Wall -arch arm64 -funwind-tables" \ + -DCMAKE_C_FLAGS=$(CMAKE_C_FLAGS) \ -DBUILD_SHARED_LIBS=OFF $(CMAKE_BUILD_SETTINGS) $(PLATFORM) $(TOOLCHAIN_FILE) \ -B $(DEP_BUILD_DIR) \ $(DEP_SOURCE_DIR) @@ -571,15 +572,18 @@ define NEW_APPLE_CMAKE_BUILD $4/$(CMAKE_CACHE): DEP_SOURCE_DIR := $(DEPS_MODULES_DIR)/$3 $4/$(CMAKE_CACHE): DEP_BUILD_DIR := $4 -# Conditionally set CFLAGS if $2 equals LIBJPEG_TURBO and BUILD_PLATFORM_ARCH equals arm64 +@echo "Value of \$2: $2" +@echo "Value of BUILD_PLATFORM_ARCH: $(BUILD_PLATFORM_ARCH)" +# Conditionally set or reset CMAKE_C_FLAGS ifeq ($2, LIBJPEG_TURBO) -$4/$(CMAKE_CACHE): CFLAGS := -Wall -arch arm64 -funwind-tables +ifeq ($(BUILD_PLATFORM_ARCH), arm64) +CMAKE_C_FLAGS := "-Wall -arch arm64 -funwind-tables" +else +CMAKE_C_FLAGS := "" # Reset to empty if not arm64 +endif +else +CMAKE_C_FLAGS := "" # Reset to empty if not LIBJPEG_TURBO endif -# 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