diff options
author | Juha Alanen <juha.alanen@mapbox.com> | 2020-02-04 13:58:19 +0200 |
---|---|---|
committer | Juha Alanen <juha.alanen@mapbox.com> | 2020-02-14 12:01:52 +0200 |
commit | 7a9f8027ac1aa93c5e073d4fe138414059125fa8 (patch) | |
tree | 8067820a28bc1303c7f0d6df462fb5ba146623b3 /CMakeLists.txt | |
parent | af7428254b0c65a934f05bd181580148d3a2d362 (diff) | |
download | qtlocation-mapboxgl-7a9f8027ac1aa93c5e073d4fe138414059125fa8.tar.gz |
[build] Enable ccache for Xcode iOS builds
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e008db2117..4509f08e73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,26 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) project("Mapbox GL Native" LANGUAGES CXX C) +find_program(CCACHE_PROGRAM ccache) +if(CCACHE_PROGRAM AND CMAKE_SYSTEM_NAME STREQUAL "iOS") + # Set up wrapper scripts + set(C_LAUNCHER "${CCACHE_PROGRAM}") + set(CXX_LAUNCHER "${CCACHE_PROGRAM}") + configure_file(${PROJECT_SOURCE_DIR}/scripts/ci/ccache-c.in ccache-c) + configure_file(${PROJECT_SOURCE_DIR}/scripts/ci/ccache-cxx.in ccache-cxx) + execute_process( + COMMAND + chmod + a+rx + "${CMAKE_BINARY_DIR}/ccache-c" + "${CMAKE_BINARY_DIR}/ccache-cxx" + ) + + # 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") +endif() + set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER Core) |