Skip to content

Commit

Permalink
fix: zlib renaming worked, fixing jpeg arch symbols - Added CMAKE_C_F…
Browse files Browse the repository at this point in the history
…LAGS
  • Loading branch information
samuelOsborne committed Dec 4, 2024
1 parent 1e0b2ae commit d80e91e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d80e91e

Please sign in to comment.