mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-12 05:49:56 -04:00
Enable ccache by default if available
This commit is contained in:
parent
3c4730aa69
commit
a0635d7ab6
@ -37,6 +37,7 @@ option(PREFER_SYSTEM_LIBARCHIVE "use system libarchive if available" OFF)
|
|||||||
option(PREFER_SYSTEM_ZSTD "use system zstd if available" OFF)
|
option(PREFER_SYSTEM_ZSTD "use system zstd if available" OFF)
|
||||||
option(PREFER_SYSTEM_XXHASH "use system xxHash if available" OFF)
|
option(PREFER_SYSTEM_XXHASH "use system xxHash if available" OFF)
|
||||||
option(PREFER_SYSTEM_GTEST "use system gtest if available" OFF)
|
option(PREFER_SYSTEM_GTEST "use system gtest if available" OFF)
|
||||||
|
option(DISABLE_CCACHE "disable ccache" OFF)
|
||||||
option(STATIC_BUILD_DO_NOT_USE "try static build (experimental)" OFF)
|
option(STATIC_BUILD_DO_NOT_USE "try static build (experimental)" OFF)
|
||||||
|
|
||||||
if(DEFINED ENV{DWARFS_LOCAL_REPO_PATH})
|
if(DEFINED ENV{DWARFS_LOCAL_REPO_PATH})
|
||||||
@ -49,6 +50,14 @@ else()
|
|||||||
set(LIBARCHIVE_GIT_REPO https://github.com/libarchive/libarchive.git)
|
set(LIBARCHIVE_GIT_REPO https://github.com/libarchive/libarchive.git)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT DISABLE_CCACHE)
|
||||||
|
find_program(CCACHE_EXE ccache)
|
||||||
|
if(CCACHE_EXE)
|
||||||
|
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXE})
|
||||||
|
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXE})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(DEFINED ENV{CCACHE_PREFIX})
|
if(DEFINED ENV{CCACHE_PREFIX})
|
||||||
add_compile_options(-Wno-gnu-line-marker)
|
add_compile_options(-Wno-gnu-line-marker)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user