mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
wafsamba: always generate compile_commands.json again, but only when the samba dependencies changed
This means the costs of the generation on a empty build are not paid anymore, which was the reason for the explicit --enable-clangdb option. Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Aug 26 13:06:09 UTC 2021 on sn-devel-184
This commit is contained in:
parent
9b9fd2a0d9
commit
5d53b848f6
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import os, sys, re
|
import os, sys, re
|
||||||
|
|
||||||
from waflib import Build, Options, Logs, Utils, Errors
|
from waflib import Build, Options, Logs, Utils, Errors, Scripting
|
||||||
from waflib.Logs import debug
|
from waflib.Logs import debug
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
from waflib import ConfigSet
|
from waflib import ConfigSet
|
||||||
@ -1087,6 +1087,9 @@ def load_samba_deps(bld, tgt_list):
|
|||||||
def check_project_rules(bld):
|
def check_project_rules(bld):
|
||||||
'''check the project rules - ensuring the targets are sane'''
|
'''check the project rules - ensuring the targets are sane'''
|
||||||
|
|
||||||
|
if bld.__class__.__name__ == "ClangDbContext":
|
||||||
|
return
|
||||||
|
|
||||||
loops = {}
|
loops = {}
|
||||||
inc_loops = {}
|
inc_loops = {}
|
||||||
|
|
||||||
@ -1167,6 +1170,13 @@ def check_project_rules(bld):
|
|||||||
|
|
||||||
Logs.info("Project rules pass")
|
Logs.info("Project rules pass")
|
||||||
|
|
||||||
|
timer = Utils.Timer()
|
||||||
|
|
||||||
|
bld.load('clang_compilation_database')
|
||||||
|
Scripting.run_command('clangdb')
|
||||||
|
|
||||||
|
debug("deps: clang_compilation_database: %s" % str(timer))
|
||||||
|
|
||||||
|
|
||||||
def CHECK_PROJECT_RULES(bld):
|
def CHECK_PROJECT_RULES(bld):
|
||||||
'''enable checking of project targets for sanity'''
|
'''enable checking of project targets for sanity'''
|
||||||
|
@ -132,9 +132,6 @@ def options(opt):
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
dest='undefined_sanitizer',
|
dest='undefined_sanitizer',
|
||||||
default=False)
|
default=False)
|
||||||
gr.add_option('--enable-clangdb',
|
|
||||||
help=("Enable use of clang_compilation_database"),
|
|
||||||
action="store_true", dest='enable_clangdb', default=False)
|
|
||||||
gr.add_option('--enable-libfuzzer',
|
gr.add_option('--enable-libfuzzer',
|
||||||
help=("Build fuzzing binaries (use ADDITIONAL_CFLAGS to specify compiler options for libFuzzer or use CC=honggfuzz/hfuzz-cc)"),
|
help=("Build fuzzing binaries (use ADDITIONAL_CFLAGS to specify compiler options for libFuzzer or use CC=honggfuzz/hfuzz-cc)"),
|
||||||
action="store_true", dest='enable_libfuzzer', default=False)
|
action="store_true", dest='enable_libfuzzer', default=False)
|
||||||
@ -660,13 +657,10 @@ struct foo bar = { .y = 'X', .x = 1 };
|
|||||||
conf.DEFINE('FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', 1)
|
conf.DEFINE('FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', 1)
|
||||||
conf.env.FUZZ_TARGET_LDFLAGS = Options.options.FUZZ_TARGET_LDFLAGS
|
conf.env.FUZZ_TARGET_LDFLAGS = Options.options.FUZZ_TARGET_LDFLAGS
|
||||||
|
|
||||||
conf.env.enable_clangdb = Options.options.enable_clangdb
|
# Create a symlink of the compile db for clangd
|
||||||
if conf.env.enable_clangdb:
|
symlink(os.path.join(conf.bldnode.abspath(), 'default/compile_commands.json'),
|
||||||
conf.load('clang_compilation_database')
|
os.path.join(conf.srcnode.abspath(), 'compile_commands.json'),
|
||||||
# Create a symlink of the compile db for clangd
|
force=True)
|
||||||
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()
|
conf.SAMBA_BUILD_ENV()
|
||||||
|
|
||||||
|
@ -786,7 +786,6 @@ tasks = {
|
|||||||
"PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} "
|
"PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} "
|
||||||
"./configure.developer ${PREFIX} "
|
"./configure.developer ${PREFIX} "
|
||||||
"--with-selftest-prefix=./bin/ab "
|
"--with-selftest-prefix=./bin/ab "
|
||||||
"--enable-clangdb "
|
|
||||||
"--with-cluster-support "
|
"--with-cluster-support "
|
||||||
"--without-ad-dc "
|
"--without-ad-dc "
|
||||||
"--bundled-libraries=!tdb"),
|
"--bundled-libraries=!tdb"),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from waflib import Logs
|
from waflib import Logs
|
||||||
|
|
||||||
Logs.info("\tSelected embedded Heimdal build")
|
if bld.__class__.__name__ != "ClangDbContext":
|
||||||
|
Logs.info("\tSelected embedded Heimdal build")
|
||||||
bld.RECURSE('source4/heimdal_build')
|
bld.RECURSE('source4/heimdal_build')
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from waflib import Logs
|
from waflib import Logs
|
||||||
|
|
||||||
Logs.info("\tSelected system Heimdal build")
|
if bld.__class__.__name__ != "ClangDbContext":
|
||||||
|
Logs.info("\tSelected system Heimdal build")
|
||||||
bld.RECURSE('source4/heimdal_build')
|
bld.RECURSE('source4/heimdal_build')
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from waflib import Logs
|
from waflib import Logs
|
||||||
|
|
||||||
Logs.info("\tSelected system MIT krb5 libraries, Heimdal use is disabled")
|
if bld.__class__.__name__ != "ClangDbContext":
|
||||||
|
Logs.info("\tSelected system MIT krb5 libraries, Heimdal use is disabled")
|
||||||
#bld.RECURSE('source4/heimdal_build')
|
#bld.RECURSE('source4/heimdal_build')
|
||||||
|
Loading…
Reference in New Issue
Block a user