Browse Source

Cmake: Add option to disable ccache

Allow ccache usage to be disabled through the ENABLE_CCACHE CMake
option, while preserving the existing automatic detection and
Emscripten exclusion behavior.

This is useful for builds where ccache is available but undesirable,
(like Coverity) and provides clear configuration messages when
ccache is skipped.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 3 months ago
parent
commit
cb24cf0aff
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 11
      CMakeLists.txt

11
CMakeLists.txt

@ -260,8 +260,10 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git/") @@ -260,8 +260,10 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git/")
endif()
endif()
find_program(CCACHE "ccache")
if(CCACHE AND NOT EMSCRIPTEN)
option(ENABLE_CCACHE "Enable ccache for faster builds" ON)
if (ENABLE_CCACHE)
find_program(CCACHE "ccache")
if(CCACHE AND NOT EMSCRIPTEN)
message(STATUS "Using ccache ${CCACHE}")
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
@ -269,6 +271,11 @@ if(CCACHE AND NOT EMSCRIPTEN) @@ -269,6 +271,11 @@ if(CCACHE AND NOT EMSCRIPTEN)
set(CMAKE_OBJCXX_COMPILER_LAUNCHER ${CCACHE})
endif()
set(ENV{CCACHE_SLOPPINESS} pch_defines,time_macros)
else()
message(STATUS "Skipping ccache")
endif()
else()
message(STATUS "Disabled ccache")
endif()
set(sdrangel_VERSION "${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}${sdrangel_VERSION_SUFFIX}" CACHE INTERNAL "")

Loading…
Cancel
Save