aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-10-02 17:17:40 +0200
committerGitHub <noreply@github.com>2022-10-02 17:17:40 +0200
commit2f80839cfe2cffcf42fe95d284a7f60f53714f67 (patch)
tree84b85fe0cd0f57a4f7e5d38de08c7a4df0c5d986 /src
parentdd35bc28403682c6c9d5c6c2779dee71ad9f10a6 (diff)
downloadrneovim-2f80839cfe2cffcf42fe95d284a7f60f53714f67.tar.gz
rneovim-2f80839cfe2cffcf42fe95d284a7f60f53714f67.tar.bz2
rneovim-2f80839cfe2cffcf42fe95d284a7f60f53714f67.zip
build: only generate compilation database for the nvim target (#20449)
Some tools like clang-tidy get confused and repeat unnecessary work if there are multiple entries with the same name. This will only generate a compilation database for cmake version 3.20 and above. Generating a compilation database is only necessary for development, so we don't need to maintain compatibility with the minimum required version. Closes https://github.com/neovim/neovim/issues/10632
Diffstat (limited to 'src')
-rwxr-xr-xsrc/nvim/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 504fe6ff4a..d07865ac6b 100755
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -446,6 +446,11 @@ set(NVIM_EXEC_LINK_LIBRARIES ${NVIM_LINK_LIBRARIES} ${LUA_PREFERRED_LIBRARIES})
add_executable(nvim ${NVIM_GENERATED_FOR_SOURCES} ${NVIM_GENERATED_FOR_HEADERS}
${NVIM_GENERATED_SOURCES} ${NVIM_SOURCES} ${NVIM_HEADERS}
${EXTERNAL_SOURCES} ${EXTERNAL_HEADERS})
+
+set_target_properties(nvim
+ PROPERTIES
+ EXPORT_COMPILE_COMMANDS ON)
+
target_link_libraries(nvim ${NVIM_EXEC_LINK_LIBRARIES})
install_helper(TARGETS nvim)
if(MSVC)