diff options
author | Ryan Egesdahl <ryan.egesdahl@mongodb.com> | 2020-10-20 08:43:36 -0700 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-26 08:56:00 +0000 |
commit | 82ef2151223ec184682e752436ac07916500253f (patch) | |
tree | 656de495698932e1fecd1725f6e4b95786193109 /src/SConscript | |
parent | 515723d10def74299cf7729148f946b538b82797 (diff) | |
download | mongo-82ef2151223ec184682e752436ac07916500253f.tar.gz |
SERVER-48291 Add global dependency pushdown to libdeps
We sometimes have situations where a dependency applies at a large
scope, such as in the case of tcmalloc, which can apply everywhere. What
we have done previously is to hack these dependencies into the LIBDEPS
environment variable by adding a builder to all nodes that can produce a
compiler result. This is, as stated previously, hackish and hard to
control, and it results in adding a Public dependency to all those
nodes.
What we now do instead is to define LIBDEPS_GLOBAL on the *build
environment* (not the Builder node) listing the targets we would like to
push down to all other nodes below that point. This has the effect of
adding those targets as Private dependencies on all Builder nodes from
that point downward, which means some common Public dependencies can be
converted to a Private dependency that is stated only once.
Diffstat (limited to 'src/SConscript')
-rw-r--r-- | src/SConscript | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/SConscript b/src/SConscript index 0b6359f7a93..fbf8e1fcecb 100644 --- a/src/SConscript +++ b/src/SConscript @@ -4,17 +4,28 @@ # to delegate to any and all per-module SConscript files. Import('env') +Import('get_option') Import('module_sconscripts') + +env = env.Clone() +if get_option("build-tools") == "next": + # Add any "global" dependencies here. This is where we make every build node + # depend on a list of other build nodes, such as an allocator or libunwind + # or libstdx or similar. + env.AppendUnique( + LIBDEPS_GLOBAL=[ + '$BUILD_DIR/third_party/shim_allocator', + ], + ) + # NOTE: We must do third_party first as it adds methods to the environment # that we need in the mongo sconscript -env = env.Clone() env.SConscript('third_party/SConscript', exports=['env']) # Inject common dependencies from third_party globally for all core mongo code # and modules. Ideally, pcre wouldn't be here, but enough things require it # now that it seems hopeless to remove it. -env = env.Clone() env.InjectThirdParty(libraries=[ 'abseil-cpp', 'boost', |