Skip to content

Commit

Permalink
waf: Symlink the compile database to the source dir for clangd
Browse files Browse the repository at this point in the history
https://github.com/ycm-core/YouCompleteMe
https://github.com/abingham/emacs-ycmd

Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>

Autobuild-User(master): Andreas Schneider <[email protected]>
Autobuild-Date(master): Thu Oct 24 08:11:19 UTC 2019 on sn-devel-184
cryptomilk committed Oct 24, 2019
1 parent b28d06b commit ab71d72
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -81,3 +81,7 @@ python/samba/provision/kerberos_implementation.py

# read by direnv to auto load environment variables
.envrc

# YouCompleteMe
compile_commands.json
.clangd/
6 changes: 6 additions & 0 deletions buildtools/wafsamba/wscript
Original file line number Diff line number Diff line change
@@ -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()


0 comments on commit ab71d72

Please sign in to comment.