diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-07-17 15:22:09 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-07-18 11:54:14 +0200 |
commit | 698542cf459e51cd72f7bc46b6979a9d67b33309 (patch) | |
tree | 651e201fabf53841a7390b11d62d3b7e2f71e389 /CMakeLists.txt | |
parent | b5c0bf1b8d18bb79ce393ac38b2e55a74863071c (diff) | |
download | qtlocation-mapboxgl-698542cf459e51cd72f7bc46b6979a9d67b33309.tar.gz |
[build] make Xcode use the correct compiler when it is installed in a non-standard location
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d709f1117c..c6758cdacb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,22 +92,28 @@ find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) set(C_LAUNCHER "${CCACHE_PROGRAM}") set(CXX_LAUNCHER "${CCACHE_PROGRAM}") - configure_file(scripts/launch-c.in launch-c) - configure_file(scripts/launch-cxx.in launch-cxx) - execute_process(COMMAND chmod a+rx "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx") if(CMAKE_GENERATOR STREQUAL "Xcode") # Set Xcode project attributes to route compilation and linking through our scripts + # Xcode doesn't include the path to the compiler/linker by default, so we'll have to add it. + configure_file(scripts/launch-c-xcode.in launch-c @ONLY) + configure_file(scripts/launch-cxx-xcode.in launch-cxx @ONLY) + set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c") set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx") set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c") set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx") else() # Support Unix Makefiles and Ninja + configure_file(scripts/launch-c.in launch-c @ONLY) + configure_file(scripts/launch-cxx.in launch-cxx @ONLY) + set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-c") set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-cxx") endif() + execute_process(COMMAND chmod a+rx "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx") + if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") # ccache splits up the compile steps, so we end up with unused arguments in some steps. # Clang also thinks that ccache isn't interactive, so we explicitly need to enable color. |