summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--buildtools/wafsamba/wscript6
2 files changed, 10 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 1b307ca80d6..ffdb2e3bd11 100644
--- a/.gitignore
+++ b/.gitignore
@@ -81,3 +81,7 @@ python/samba/provision/kerberos_implementation.py
# read by direnv to auto load environment variables
.envrc
+
+# YouCompleteMe
+compile_commands.json
+.clangd/
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 2b4423e2fa7..28d81ebd602 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -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()