Skip to content

Commit

Permalink
CMakeLists: Add optional fast compile using ccache
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei-Fabian-Pop <[email protected]>
  • Loading branch information
Andrei-Fabian-Pop authored and adisuciu committed Nov 22, 2024
1 parent 95fc0b7 commit 1b78de3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Default build type: RelWithDebInfo" FORCE)
endif()

find_program(CCACHE_FOUND ccache)
if(NOT DEFINED ENV{BUILD_HOST} AND CCACHE_FOUND)
message(STATUS "Using ccache.")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
else()
message(STATUS "Not using ccache.")
endif()

# Make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake/Modules)

Expand Down

0 comments on commit 1b78de3

Please sign in to comment.