Skip to content

Commit

Permalink
Add CCache
Browse files Browse the repository at this point in the history
  • Loading branch information
fintarin committed May 3, 2024
1 parent bba34bb commit 37d4156
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project(
VERSION 0.9.0)

include(cmake/PreventInSourceBuilds.cmake)
include(cmake/CCache.cmake)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
10 changes: 10 additions & 0 deletions cmake/CCache.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Enable ccache

find_program(CCACHE_PROGRAM ccache)

if(CCACHE_PROGRAM)
option(${PROJECT_NAME}_enable_ccache "Enable ccache" ON)
if(${PROJECT_NAME}_enable_ccache)
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif()
endif()

0 comments on commit 37d4156

Please sign in to comment.