From 65b99dc5f81fa1a616bcf1ba09b709c44355fb73 Mon Sep 17 00:00:00 2001 From: Yuval Shekel Date: Wed, 21 Aug 2024 23:06:50 +0300 Subject: [PATCH] use ccache if available --- device_api.md | 0 icicle_v3/CMakeLists.txt | 13 +++++++++++++ 2 files changed, 13 insertions(+) delete mode 100644 device_api.md diff --git a/device_api.md b/device_api.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/icicle_v3/CMakeLists.txt b/icicle_v3/CMakeLists.txt index 89d23255e..e0350d538 100644 --- a/icicle_v3/CMakeLists.txt +++ b/icicle_v3/CMakeLists.txt @@ -17,6 +17,19 @@ endif() # Print the selected build type message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") +# Find the ccache program +find_program(CCACHE_PROGRAM ccache) +# If ccache is found, use it as the compiler launcher +if(CCACHE_PROGRAM) + message(STATUS "ccache found: ${CCACHE_PROGRAM}") + + # Use ccache for C and C++ compilers + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM}) +else() + message(STATUS "ccache not found") +endif() + set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Build options