aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-10-22 09:21:05 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-10-25 10:15:34 +0200
commitff70e53b65e700db6c53c48eaa84fba77b815450 (patch)
tree32abf4ed5b99f4351d20581af43140bc7c753a29 /CMakeLists.txt
parent1a41f98a6ba0fedcb6338396b27bea1ecf4a3998 (diff)
downloadcmocka-ff70e53b65e700db6c53c48eaa84fba77b815450.tar.gz
cmocka-ff70e53b65e700db6c53c48eaa84fba77b815450.tar.xz
cmocka-ff70e53b65e700db6c53c48eaa84fba77b815450.zip
cmake: Link compile database to source dir for clangd
See https://github.com/ycm-core/YouCompleteMe https://github.com/abingham/emacs-ycmd Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3e9193..7e3ede3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,3 +113,8 @@ install(
# Add 'make dist' target which makes sure to invoke cmake before
add_custom_target(dist
COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
+
+# Link combile database for clangd
+execute_process(COMMAND cmake -E create_symlink
+ "${CMAKE_BINARY_DIR}/compile_commands.json"
+ "${CMAKE_SOURCE_DIR}/compile_commands.json")