diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-11-08 11:11:14 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2016-11-09 18:29:11 +0000 |
commit | 8e5e6ddc5e526abc84d162f24decfa7be78887b1 (patch) | |
tree | 704aed45e0d134170c427f9b8d719ccb8ae27f21 /CMakeLists.txt | |
parent | 857b80e41489f9064e8f5cbdd8c05b3a9ce8adb3 (diff) |
CMake: Enable ccache for gcc and clang.
Add an option to check for and use ccache. Disable it by default.
Change-Id: Ifc928d22715b7e06e53115455b31dbeaf2ee8332
Reviewed-on: https://code.wireshark.org/review/18715
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 93ab94c5cf..50288264f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1107,8 +1107,18 @@ include(ConfigureChecks.cmake) include(TestBigEndian) test_big_endian(WORDS_BIGENDIAN) +# Global properties set_property(GLOBAL PROPERTY USE_FOLDERS ON) +if(ENABLE_CCACHE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")) + # http://stackoverflow.com/a/24305849/82195 + find_program(CCACHE_EXECUTABLE ccache) + if(CCACHE_EXECUTABLE) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_EXECUTABLE}") + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_EXECUTABLE}") + endif() +endif() + # The top level checkAPIs target, add before subdirectory calls so it's avaiable to all add_custom_target(checkAPI) set_target_properties(checkAPI |