summaryrefslogtreecommitdiff
path: root/src/third_party/SConscript
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-04-03 16:00:59 -0400
committerBilly Donahue <billy.donahue@mongodb.com>2019-07-15 11:32:31 -0400
commitd6bd2c5885215c29d723f02d8607f2c6d662aacc (patch)
treec89ac8d7e58d25f6c6f749231c0c0c1556722e20 /src/third_party/SConscript
parent71fced4ef1bdbc1e5b517057eb15be256eaf0ba7 (diff)
downloadmongo-d6bd2c5885215c29d723f02d8607f2c6d662aacc.tar.gz
SERVER-33259 add libunwind to third_party
Diffstat (limited to 'src/third_party/SConscript')
-rw-r--r--src/third_party/SConscript48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
index a8156db6661..d2969b60cbd 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -1,6 +1,7 @@
# -*- mode: python -*-
import libdeps
+import json
Import("env use_system_version_of_library usemozjs get_option")
Import("wiredtiger")
@@ -34,7 +35,9 @@ thirdPartyEnvironmentModifications = {
},
'timelib' : {
'CPPPATH' : ['#/src/third_party/timelib' + timelibSuffix],
- }
+ },
+ 'unwind' : {
+ },
}
def injectMozJS(thisEnv):
@@ -209,6 +212,38 @@ s2Env.InjectThirdParty(libraries=['s2', 'boost', 'abseil-cpp', 'fmt', 'safeint']
s2Env.InjectMongoIncludePaths()
s2Env.SConscript('s2/SConscript', exports={'env' : s2Env})
+unwindEnv = None
+if use_system_version_of_library("unwind"):
+ unwindEnv = env.Clone(
+ SYSLIBDEPS=[
+ env['LIBDEPS_UNWIND_SYSLIBDEP'],
+ ])
+else:
+ unwindEnv = env.Clone()
+ unwindEnv.InjectThirdParty(libraries=['unwind'])
+ unwindEnv.InjectMongoIncludePaths()
+
+ def registerConsumerModifications(env, **kwargs):
+ for k,v in kwargs.items():
+ thirdPartyEnvironmentModifications['unwind'][k] = v
+
+ unwindEnv.AddMethod(registerConsumerModifications, 'RegisterConsumerModifications')
+ unwindEnv.SConscript('unwind/SConscript', exports={'env' : unwindEnv})
+
+ print("third_party/unwind modifications:",
+ ",".join(thirdPartyEnvironmentModifications['unwind'].keys()))
+
+ unwindEnv = unwindEnv.Clone(
+ LIBDEPS_INTERFACE=[
+ 'unwind/unwind',
+ ])
+
+unwindEnv.Library(
+ target="shim_unwind",
+ source=[
+ 'shim_unwind.cpp',
+ ])
+
if use_system_version_of_library("fmt"):
fmtEnv = env.Clone(
@@ -436,14 +471,13 @@ if gperftoolsEnv['MONGO_ALLOCATOR'] in ["tcmalloc", "tcmalloc-experimental"]:
gperftoolsEnv.InjectThirdParty(libraries=['gperftools'])
# Allow gperftools to determine its own consumer-side include/ dirs.
# Needed because those are in a platform-specific subdirectory.
- mods = {}
+ def registerConsumerModifications(env, **kwargs):
+ for k,v in kwargs.items():
+ thirdPartyEnvironmentModifications['gperftools'][k] = v
+ gperftoolsEnv.AddMethod(registerConsumerModifications, 'RegisterConsumerModifications')
gperftoolsEnv.SConscript(
'gperftools' + gperftoolsSuffix + '/SConscript',
- exports={'env' : gperftoolsEnv, 'consumerMods' : mods})
- # Propagate settings that were deposited into 'mods' by gperftools' SConscript.
- for k,v in mods.items():
- thirdPartyEnvironmentModifications['gperftools'][k] = v
-
+ exports={'env' : gperftoolsEnv})
gperftoolsEnv = gperftoolsEnv.Clone(
LIBDEPS_INTERFACE=[
'gperftools' + gperftoolsSuffix + '/tcmalloc_minimal',