diff options
author | dundargoc <gocdundar@gmail.com> | 2022-10-09 11:38:32 +0200 |
---|---|---|
committer | dundargoc <gocdundar@gmail.com> | 2022-10-09 11:44:47 +0200 |
commit | c422046e43359f8d02a0d48bc57f62b9d2542ccf (patch) | |
tree | ad52fa7f4e075b019282eb73059df8fe547e55cf /src | |
parent | edc8a1f04631b021f9c5e79f7162e34f7c3299db (diff) | |
download | rneovim-c422046e43359f8d02a0d48bc57f62b9d2542ccf.tar.gz rneovim-c422046e43359f8d02a0d48bc57f62b9d2542ccf.tar.bz2 rneovim-c422046e43359f8d02a0d48bc57f62b9d2542ccf.zip |
build: generate compilation database for older cmake versions
Fall back to the older method of setting CMAKE_EXPORT_COMPILE_COMMANDS
for cmake versions less than 3.20. This isn't recommended as it's not
possible to exclude targets from generating a compilation database,
which may cause some tools like clang-tidy to do unnecessary work. But
having an unoptimized compilation database is still useful enough that
it's worth having.
Diffstat (limited to 'src')
-rwxr-xr-x | src/nvim/CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 4c8defad45..2960e6d9d2 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -451,6 +451,10 @@ set_target_properties(nvim PROPERTIES EXPORT_COMPILE_COMMANDS ON) +if(${CMAKE_VERSION} VERSION_LESS 3.20) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +endif() + target_link_libraries(nvim ${NVIM_EXEC_LINK_LIBRARIES}) install_helper(TARGETS nvim) if(MSVC) |