Skip to content

Commit

Permalink
fix ios to enable ccache on builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jaromil committed Sep 24, 2024
1 parent 8d5238f commit 5169075
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions build/apple-ios.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## Initialize build defaults
include build/init.mk

ifdef CCACHE
milagro_cmake_flags += -DCMAKE_C_COMPILER_LAUNCHER=ccache
pfxcc += ccache
endif

OS := iphoneos
cc := $(shell xcrun --sdk iphoneos -f gcc 2>/dev/null)
cc := ${pfxcc} $(shell xcrun --sdk iphoneos -f gcc 2>/dev/null)
ar := $(shell xcrun --sdk iphoneos -f ar 2>/dev/null)
ld := $(shell xcrun --sdk iphoneos -f ld 2>/dev/null)
ranlib := $(shell xcrun --sdk iphoneos -f ranlib 2>/dev/null)
Expand All @@ -12,24 +17,21 @@ cflags += -DLIBCMALLOC
lua_cflags += -DLUA_USE_IOS
ldflags := -lm
platform := ios
quantum_proof_cc := ${cc}
ed25519_cc := ${cc}
libcc_cc := ${cc}

ios-armv7: cflags += -arch armv7 -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path 2>/dev/null)
ios-armv7: quantum_proof_cc := ${cc}
ios-armv7: ed25519_cc := ${cc}
ios-armv7: libcc_cc := ${cc}
ios-armv7: ${BUILD_DEPS} ${ZEN_SOURCES}
TARGET=armv7 libtool -static -o zenroom-ios-armv7.a \
${ZEN_SOURCES} ${ldadd}

ios-arm64: cflags += -arch arm64 -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path 2>/dev/null)
ios-arm64: quantum_proof_cc := ${cc}
ios-arm64: ed25519_cc := ${cc}
ios-arm64: libcc_cc := ${cc}
ios-arm64: ${BUILD_DEPS} ${ZEN_SOURCES}
TARGET=arm64 libtool -static -o zenroom-ios-arm64.a \
${ZEN_SOURCES} ${ldadd}

ios-sim: cc := $(shell xcrun --sdk iphonesimulator -f gcc 2>/dev/null)
ios-sim: cc := ${pfxcc} $(shell xcrun --sdk iphonesimulator -f gcc 2>/dev/null)
ios-sim: ar := $(shell xcrun --sdk iphonesimulator -f ar 2>/dev/null)
ios-sim: ld := $(shell xcrun --sdk iphonesimulator -f ld 2>/dev/null)
ios-sim: ranlib := $(shell xcrun --sdk iphonesimulator -f ranlib 2>/dev/null)
Expand Down

0 comments on commit 5169075

Please sign in to comment.