Files
MapLibreParticleLab/platform/ios/ccache.cmake
Sudarsana Babu Nagineni dc86c60436 [build] Fix the output path of the iOS ccache scripts
iOS ccache wrapper scripts should be in the top level
of the CMake build tree, so fix the output path in the
configure_file().
2020-04-21 17:58:32 +03:00

28 lines
1.1 KiB
CMake

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
# Set up wrapper scripts
set(C_LAUNCHER "${CCACHE_PROGRAM}")
set(CXX_LAUNCHER "${CCACHE_PROGRAM}")
configure_file(${PROJECT_SOURCE_DIR}/platform/ios/ccache-c.in ${CMAKE_BINARY_DIR}/ccache-c)
configure_file(${PROJECT_SOURCE_DIR}/platform/ios/ccache-cxx.in ${CMAKE_BINARY_DIR}/ccache-cxx)
execute_process(
COMMAND
chmod
a+rx
"${CMAKE_BINARY_DIR}/ccache-c"
"${CMAKE_BINARY_DIR}/ccache-cxx"
)
if(CMAKE_GENERATOR STREQUAL "Xcode")
# Set Xcode project attributes to route compilation and linking through our scripts
set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/ccache-c")
set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/ccache-cxx")
set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/ccache-c")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/ccache-cxx")
else()
# Support Unix Makefiles and Ninja
set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/ccache-c")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/ccache-cxx")
endif()
endif()