]> granicus.if.org Git - esp-idf/commitdiff
cmake: restore ccache use when present
authorRenz Christian Bagaporo <renz@espressif.com>
Mon, 6 May 2019 11:57:45 +0000 (19:57 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Mon, 6 May 2019 12:04:07 +0000 (20:04 +0800)
Closes https://github.com/espressif/esp-idf/issues/3116

tools/cmake/project.cmake

index 034566e7fcc14f24b31ed4cc4e4af8d08330c430..1bf088c3f864bea2cf1cd06b5133a522131999f6 100644 (file)
@@ -83,6 +83,15 @@ macro(project name)
     # Now the configuration is loaded, set the toolchain appropriately
     idf_set_toolchain()
 
+    # Enable ccache if it's on the path
+    if(NOT CCACHE_DISABLE)
+        find_program(CCACHE_FOUND ccache)
+        if(CCACHE_FOUND)
+            message(STATUS "ccache will be used for faster builds")
+            set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+        endif()
+    endif()
+
     __project(${name} C CXX ASM)
 
     set(IDF_BUILD_ARTIFACTS ON)