]> granicus.if.org Git - taglib/commitdiff
Added ccache support for faster compilation
authorg-coder <garima.g@samsung.com>
Thu, 26 Nov 2015 09:42:23 +0000 (15:12 +0530)
committerg-coder <garima.g@samsung.com>
Thu, 26 Nov 2015 09:42:23 +0000 (15:12 +0530)
ccache is a compiler cache. It speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again. It provides support for C/C++ languages.
It makes compilation fast if it is available on the machine.
https://ccache.samba.org/

CMakeLists.txt

index 2fe1dadb6fa19cc4fbae53a25ec9c09da9c37bda..27c146a9dd4e9418e176a6b9f2cf8249b55fe2a5 100644 (file)
@@ -137,6 +137,12 @@ 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(CCACHE_FOUND)
+
 # uninstall target
 configure_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"