summaryrefslogtreecommitdiff
path: root/site_scons/libdeps.py
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2018-09-20 15:42:11 -0400
committerAndrew Morrow <acm@mongodb.com>2018-09-21 15:45:39 -0400
commit92b9046433bf8a50dae15f733485adb859d7ed72 (patch)
tree1ac185aa7bb2199d2e385c2f0467cc11157f281f /site_scons/libdeps.py
parent340e33483d69983c976dff0ed5ab2ff0b036237c (diff)
downloadmongo-92b9046433bf8a50dae15f733485adb859d7ed72.tar.gz
SERVER-37170 Dont let shared archives become reverse edges for programs
Diffstat (limited to 'site_scons/libdeps.py')
-rw-r--r--site_scons/libdeps.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/site_scons/libdeps.py b/site_scons/libdeps.py
index 5bc530ba1e7..d2844a8d68b 100644
--- a/site_scons/libdeps.py
+++ b/site_scons/libdeps.py
@@ -234,7 +234,7 @@ def __append_direct_libdeps(node, prereq_nodes):
node.attributes.libdeps_direct = []
node.attributes.libdeps_direct.extend(prereq_nodes)
-def make_libdeps_emitter(dependency_builder, dependency_map=dependency_visibility_ignored):
+def make_libdeps_emitter(dependency_builder, dependency_map=dependency_visibility_ignored, ignore_progdeps=False):
def libdeps_emitter(target, source, env):
"""SCons emitter that takes values from the LIBDEPS environment variable and
@@ -288,20 +288,21 @@ def make_libdeps_emitter(dependency_builder, dependency_map=dependency_visibilit
dependentNode = lib_node_factory(dependentWithIxes)
__append_direct_libdeps(dependentNode, [dependency(target[0], dependency_map[visibility])])
- for dependent in env.get('PROGDEPS_DEPENDENTS', []):
- if dependent is None:
- continue
+ if not ignore_progdeps:
+ for dependent in env.get('PROGDEPS_DEPENDENTS', []):
+ if dependent is None:
+ continue
- visibility = dependency.Public
- if isinstance(dependent, tuple):
- # TODO: Error here? Non-public PROGDEPS_DEPENDENTS probably are meaningless
- visibility = dependent[1]
- dependent = dependent[0]
+ visibility = dependency.Public
+ if isinstance(dependent, tuple):
+ # TODO: Error here? Non-public PROGDEPS_DEPENDENTS probably are meaningless
+ visibility = dependent[1]
+ dependent = dependent[0]
- dependentWithIxes = SCons.Util.adjustixes(
- dependent, prog_builder.get_prefix(env), prog_builder.get_suffix(env))
- dependentNode = prog_node_factory(dependentWithIxes)
- __append_direct_libdeps(dependentNode, [dependency(target[0], dependency_map[visibility])])
+ dependentWithIxes = SCons.Util.adjustixes(
+ dependent, prog_builder.get_prefix(env), prog_builder.get_suffix(env))
+ dependentNode = prog_node_factory(dependentWithIxes)
+ __append_direct_libdeps(dependentNode, [dependency(target[0], dependency_map[visibility])])
return target, source
@@ -344,7 +345,7 @@ def setup_environment(env, emitting_shared=False):
LIBDEPS_LIBEMITTER=make_libdeps_emitter('StaticLibrary'),
LIBEMITTER=make_indirect_emitter('LIBDEPS_LIBEMITTER'),
- LIBDEPS_SHAREMITTER=make_libdeps_emitter('SharedArchive'),
+ LIBDEPS_SHAREMITTER=make_libdeps_emitter('SharedArchive', ignore_progdeps=True),
SHAREMITTER=make_indirect_emitter('LIBDEPS_SHAREMITTER'),
LIBDEPS_SHLIBEMITTER=make_libdeps_emitter('SharedLibrary', dependency_visibility_honored),