summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2020-07-23 21:39:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-23 21:52:22 +0000
commitd986854f5ec4fda16d22baab2d380b202626661f (patch)
treee477ddeb82864d951a3a94cadfc76709cf78730d /SConstruct
parent2af311b7cbd17ecdddef919acac8d22f96391686 (diff)
downloadmongo-d986854f5ec4fda16d22baab2d380b202626661f.tar.gz
SERVER-48638 Added LibdepsLinter to enforce LIBDEPS rules
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct14
1 files changed, 13 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index bc7a6135506..901c6cb05e8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -525,6 +525,15 @@ add_option('enable-usdt-probes',
const='on',
)
+add_option('libdeps-linting',
+ choices=['on', 'off', 'print'],
+ const='on',
+ default='on',
+ help='Enable linting of libdeps. Default is on, optionally \'print\' will not stop the build.',
+ nargs='?',
+ type='choice',
+)
+
try:
with open("version.json", "r") as version_fp:
version_data = json.load(version_fp)
@@ -1643,7 +1652,10 @@ if env['_LIBDEPS'] == '$_LIBDEPS_OBJS':
# command but instead runs a function.
env["BUILDERS"]["StaticLibrary"].action = SCons.Action.Action(write_uuid_to_file, "Generating placeholder library $TARGET")
-libdeps.setup_environment(env, emitting_shared=(link_model.startswith("dynamic")))
+libdeps.setup_environment(
+ env,
+ emitting_shared=(link_model.startswith("dynamic")),
+ linting=get_option('libdeps-linting'))
# Both the abidw tool and the thin archive tool must be loaded after
# libdeps, so that the scanners they inject can see the library