mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29:27 +02:00
CMake: add options to disable sccache and ccache if they are found
Signed-off-by: Be <be@mixxx.org>
This commit is contained in:
parent
af90feeb13
commit
76c63fa0fc
@ -218,6 +218,11 @@ cmake --install build
|
|||||||
for Windows and macOS; OFF by default for Linux.
|
for Windows and macOS; OFF by default for Linux.
|
||||||
* **VCPKG_ROOT** (file path): path to vcpkg Git repository, defaults to
|
* **VCPKG_ROOT** (file path): path to vcpkg Git repository, defaults to
|
||||||
using the vcpkg submodule in the Tenacity repository
|
using the vcpkg submodule in the Tenacity repository
|
||||||
|
* **SCCACHE** (ON|OFF): whether to use sccache for compiler caching to
|
||||||
|
speed up rebuilds. ON by default if sccache is installed.
|
||||||
|
* **CCACHE** (ON|OFF): whether to use ccache for compiler caching to speed
|
||||||
|
up rebuilds. ON by default if ccache is installed. If sccache and ccache
|
||||||
|
are both installed, sccache will be prefered.
|
||||||
|
|
||||||
The following feature options are enabled by default if the required libraries
|
The following feature options are enabled by default if the required libraries
|
||||||
are found. You may explicitly disable them if you prefer or your distribution
|
are found. You may explicitly disable them if you prefer or your distribution
|
||||||
|
@ -163,20 +163,28 @@ project( Tenacity )
|
|||||||
# Use ccache if available
|
# Use ccache if available
|
||||||
find_program( CCACHE_PROGRAM ccache )
|
find_program( CCACHE_PROGRAM ccache )
|
||||||
mark_as_advanced( FORCE CCACHE_PROGRAM )
|
mark_as_advanced( FORCE CCACHE_PROGRAM )
|
||||||
|
if(NOT "${CCACHE_PROGRAM}" STREQUAL "CCACHE_PROGRAM-NOTFOUND")
|
||||||
|
option(CCACHE "Use ccache for compiler caching to speed up rebuilds." ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
find_program( SCCACHE_PROGRAM sccache )
|
find_program( SCCACHE_PROGRAM sccache )
|
||||||
mark_as_advanced( FORCE SCCACHE_PROGRAM )
|
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( CCACHE_PROGRAM )
|
# Prefer sccache if both ccache and sccache are found because Windows users may have
|
||||||
message( STATUS "Found ccache: ${CCACHE_PROGRAM}" )
|
# ccache installed with MinGW which would not work with MSVC.
|
||||||
set( CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" )
|
if(SCCACHE)
|
||||||
set( CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" )
|
message( STATUS "Using sccache for compiler caching to speed up rebuilds" )
|
||||||
elseif( SCCACHE_PROGRAM )
|
|
||||||
message( STATUS "Found sccache: ${SCCACHE_PROGRAM}" )
|
|
||||||
set( CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" )
|
set( CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" )
|
||||||
set( CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" )
|
set( CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" )
|
||||||
|
elseif(CCACHE)
|
||||||
|
message( STATUS "Using ccache for compiler caching to speed up rebuilds" )
|
||||||
|
set( CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" )
|
||||||
|
set( CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" )
|
||||||
else()
|
else()
|
||||||
message( STATUS "Could NOT find ccache nor sccache, no compiler caching enabled" )
|
message( STATUS "No compiler caching enabled. Install sccache or ccache to enable compiler caching." )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Load our functions/macros
|
# Load our functions/macros
|
||||||
|
Loading…
x
Reference in New Issue
Block a user