diff options
author | dundargoc <gocdundar@gmail.com> | 2024-05-08 21:49:57 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-05-09 16:39:45 +0200 |
commit | c18d7941effaf60810a0891d8aa2dd9cd0170526 (patch) | |
tree | 9bdd05f8c3f2aa8456afadbb6c4b87d8088e2db9 | |
parent | d3fa88b70f6f96ec4bc505968afec1dedb3b450b (diff) | |
download | rneovim-c18d7941effaf60810a0891d8aa2dd9cd0170526.tar.gz rneovim-c18d7941effaf60810a0891d8aa2dd9cd0170526.tar.bz2 rneovim-c18d7941effaf60810a0891d8aa2dd9cd0170526.zip |
build: allow sccache as compiler cache
Also enable caching for dependencies.
Closes https://github.com/neovim/neovim/issues/28670
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | cmake/Deps.cmake | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cdc834d0fc..933bc16aa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,11 +50,6 @@ file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt) set_directory_properties(PROPERTIES EP_PREFIX "${DEPS_BUILD_DIR}") -find_program(CCACHE_PRG ccache) -if(CCACHE_PRG) - set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG}) -endif() - if(NOT CI_BUILD) set(CMAKE_INSTALL_MESSAGE NEVER) endif() diff --git a/cmake/Deps.cmake b/cmake/Deps.cmake index 0d4cb7d469..413e3a08a9 100644 --- a/cmake/Deps.cmake +++ b/cmake/Deps.cmake @@ -23,6 +23,12 @@ if(POLICY CMP0092) list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW) endif() +find_program(CACHE_PRG NAMES ccache sccache) +if(CACHE_PRG) + set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG}) + list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER}) +endif() + # MAKE_PRG if(UNIX) find_program(MAKE_PRG NAMES gmake make) @@ -58,7 +64,8 @@ function(get_externalproject_options name DEPS_IGNORE_SHA) set(EXTERNALPROJECT_OPTIONS DOWNLOAD_NO_PROGRESS TRUE - EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL}) + EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL} + CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) if(NOT ${DEPS_IGNORE_SHA}) list(APPEND EXTERNALPROJECT_OPTIONS URL_HASH SHA256=${${name_allcaps}_SHA256}) |