Skip to content

Commit

Permalink
CMake: Fix usage with ccache
Browse files Browse the repository at this point in the history
Add missing -DCCACHE option to fix builds with ccache.

Signed-off-by: Avery King <[email protected]>
  • Loading branch information
Avery King committed Nov 28, 2024
1 parent 71dbab3 commit 2322e8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,14 @@ else()
message( STATUS "Could NOT find ccache nor sccache, no compiler caching enabled" )
endif()

find_program( SCCACHE_PROGRAM sccache )
mark_as_advanced( FORCE SCCACHE_PROGRAM )
if(NOT "${SCCACHE_PROGRAM}" STREQUAL "SCCACHE_PROGRAM-NOTFOUND")
option(SCCACHE "Use sccache for compiler caching to speed up rebuilds." ON)
endif()

if(NOT "${CCACHE_PROGRAM}" STREQUAL "CCACHE_PROGRAM-NOTFOUND")
option(CCACHE "Use ccache for compiler caching to speed up rebuilds." ON)
endif()

# Prefer sccache if both ccache and sccache are found because Windows users may have
# ccache installed with MinGW which would not work with MSVC.
if(SCCACHE)
Expand Down

0 comments on commit 2322e8a

Please sign in to comment.