waf: Symlink the compile database to the source dir for clangd
authorAndreas Schneider <asn@samba.org>
Tue, 22 Oct 2019 07:32:58 +0000 (09:32 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 24 Oct 2019 08:11:19 +0000 (08:11 +0000)
https://github.com/ycm-core/YouCompleteMe
https://github.com/abingham/emacs-ycmd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 24 08:11:19 UTC 2019 on sn-devel-184

.gitignore
buildtools/wafsamba/wscript

index 1b307ca80d60774bb42fc5bdaa7b8d287da6777f..ffdb2e3bd11d244e7e24aab13b120971d8b8774e 100644 (file)
@@ -81,3 +81,7 @@ python/samba/provision/kerberos_implementation.py
 
 # read by direnv to auto load environment variables
 .envrc
+
+# YouCompleteMe
+compile_commands.json
+.clangd/
index 2b4423e2fa720de009b728d9471e204b41f35ca7..28d81ebd6025ae0d0dfd99867646af0c2239b332 100644 (file)
@@ -6,6 +6,7 @@ import os, sys
 from waflib import Configure, Logs, Options, Utils, Context, Errors
 import wafsamba
 from samba_utils import os_path_relpath
+from samba_utils import symlink
 from optparse import SUPPRESS_HELP
 
 # this forces configure to be re-run if any of the configure
@@ -599,6 +600,11 @@ struct foo bar = { .y = 'X', .x = 1 };
 
     conf.load('clang_compilation_database')
 
+    # Create a symlink of the compile db for clangd
+    symlink(os.path.join(conf.bldnode.abspath(), 'default/compile_commands.json'),
+            os.path.join(conf.srcnode.abspath(), 'compile_commands.json'),
+            force=True)
+
     conf.SAMBA_BUILD_ENV()