mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
iOS CI build: Make XCode work with ccache
This commit is contained in:
parent
46d785c371
commit
d14c872164
@ -222,6 +222,24 @@ if(APPLE_IOS)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED_FOR_APPS YES)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${BUNDLE_IDENTIFIER_PREFIX}.$(PRODUCT_NAME)")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2")
|
||||
|
||||
if(CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
find_program(CCACHE "ccache")
|
||||
if(CCACHE)
|
||||
# https://stackoverflow.com/a/36515503/2278742
|
||||
# Set up wrapper scripts
|
||||
configure_file(ios/launch-c.in ios/launch-c)
|
||||
configure_file(ios/launch-cxx.in ios/launch-cxx)
|
||||
execute_process(COMMAND chmod a+rx
|
||||
"${CMAKE_BINARY_DIR}/ios/launch-c"
|
||||
"${CMAKE_BINARY_DIR}/ios/launch-cxx")
|
||||
# Set Xcode project attributes to route compilation through our scripts
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/ios/launch-c")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/ios/launch-cxx")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/ios/launch-c")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/ios/launch-cxx")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE_MACOS)
|
||||
|
3
ios/launch-c.in
Normal file
3
ios/launch-c.in
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
export CCACHE_CPP2=true
|
||||
ccache clang "$@"
|
3
ios/launch-cxx.in
Normal file
3
ios/launch-cxx.in
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
export CCACHE_CPP2=true
|
||||
ccache clang++ "$@"
|
Loading…
Reference in New Issue
Block a user