diff options
-rw-r--r-- | CONTRIBUTING.md | 5 | ||||
-rwxr-xr-x | src/nvim/CMakeLists.txt | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ce0f2ace05..f1c7ca1cb3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,11 @@ Developer guidelines make distclean make # Nvim build system uses ninja automatically, if available. ``` +- Install `ccache` for faster rebuilds of Nvim. Nvim will use it automatically + if it's found. To disable caching use: + ``` + CCACHE_DISABLE=true make + ``` Pull requests (PRs) --------------------- diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 77ed0490d8..d1bf08f3fb 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -688,6 +688,13 @@ 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() |