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.
28 lines
715 B
Python
Executable File
28 lines
715 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Scons module."""
|
|
|
|
import os
|
|
import sys
|
|
|
|
SCONS_VERSION = os.environ.get('SCONS_VERSION', "3.1.2")
|
|
|
|
MONGODB_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|
SCONS_DIR = os.path.join(MONGODB_ROOT, 'src', 'third_party', 'scons-' + SCONS_VERSION,
|
|
'scons-local-' + SCONS_VERSION)
|
|
|
|
if not os.path.exists(SCONS_DIR):
|
|
print("Could not find SCons in '%s'" % (SCONS_DIR))
|
|
sys.exit(1)
|
|
|
|
sys.path = [SCONS_DIR] + sys.path
|
|
|
|
try:
|
|
import SCons.Script
|
|
except ImportError as import_err:
|
|
print("Could not import SCons from '%s'" % (SCONS_DIR))
|
|
print("ImportError:", import_err)
|
|
sys.exit(1)
|
|
|
|
if __name__ == '__main__':
|
|
SCons.Script.main()
|