diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-01-29 17:02:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-29 17:02:34 +0100 |
commit | 930125647fd99de78b6845f9a4db637ae4517b84 (patch) | |
tree | e339a0c54d1123a017af6141a9ae6f251796e448 | |
parent | 8144deb0989ea5c61fe9a1a5802d230eba33dfdd (diff) | |
download | rneovim-930125647fd99de78b6845f9a4db637ae4517b84.tar.gz rneovim-930125647fd99de78b6845f9a4db637ae4517b84.tar.bz2 rneovim-930125647fd99de78b6845f9a4db637ae4517b84.zip |
build: enable ccache project-wide (#22045)
Currently, only the nvim target uses ccache but not libnvim or
unittests. It is generally a good idea to operate on targets rather than
globally, but this is an exception as there isn't a target where we
don't want to use ccache on.
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rwxr-xr-x | src/nvim/CMakeLists.txt | 7 |
2 files changed, 5 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 493c212996..34a78dc9b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,11 @@ set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches) set_property(GLOBAL PROPERTY USE_FOLDERS ON) +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() + # Prefer our bundled versions of dependencies. if(DEFINED ENV{DEPS_BUILD_DIR}) if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index d1bf08f3fb..77ed0490d8 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -688,13 +688,6 @@ set_target_properties(nvim EXPORT_COMPILE_COMMANDS ON ENABLE_EXPORTS TRUE) -find_program(CCACHE_PRG ccache) -if(CCACHE_PRG) - set_target_properties(nvim - PROPERTIES - C_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;CCACHE_SLOPPINESS=pch_defines,time_macros;${CCACHE_PRG}") -endif() - if(${CMAKE_VERSION} VERSION_LESS 3.20) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) endif() |