diff options
author | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2015-11-27 12:15:03 +0900 |
---|---|---|
committer | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2015-11-27 12:15:03 +0900 |
commit | 6b836c6ba70a4b8f4c213fcf8e30effa35797354 (patch) | |
tree | 3f263e735e57a244e9c40376ee44d56994f5e6a5 /CMakeLists.txt | |
parent | f5a3f2b6c132a2c83d445c2c2947e6f365fdab4b (diff) |
Add ENABLE_CCACHE build option to allow users opt in to use ccache.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dcb72b4..9491d47f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,15 @@ else() endif() option(ENABLE_STATIC_RUNTIME "Visual Studio, link with runtime statically" OFF) +option(ENABLE_CCACHE "Use ccache when building libtag" OFF) +if(ENABLE_CCACHE) + find_program(CCACHE_FOUND ccache) + if(CCACHE_FOUND) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + endif() +endif() + option(VISIBILITY_HIDDEN "Build with -fvisibility=hidden" OFF) if(VISIBILITY_HIDDEN) add_definitions(-fvisibility=hidden) @@ -146,12 +155,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake" "${CMAKE_CURRENT_BIN file(COPY doc/taglib.png DESTINATION doc) add_custom_target(docs doxygen) -find_program(CCACHE_FOUND ccache) -if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -endif() - # uninstall target configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) |