summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2021-07-23 17:13:10 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-27 17:29:05 +0000
commit0c1e060e7e87a32673e9a6b0311663aa4875544b (patch)
treec7518bbc743645565731751c274e627dcd59e451
parent1b8d8f798c353b2661e9063281ce3fe3c6882545 (diff)
downloadmongo-0c1e060e7e87a32673e9a6b0311663aa4875544b.tar.gz
SERVER-48291 Remove need for individual third_party shim source files
-rw-r--r--SConstruct18
-rw-r--r--site_scons/libdeps_next.py4
-rw-r--r--src/third_party/SConscript24
-rw-r--r--src/third_party/shim_abseil.cpp3
-rw-r--r--src/third_party/shim_allocator.cpp2
-rw-r--r--src/third_party/shim_asio.cpp3
-rw-r--r--src/third_party/shim_benchmark.cpp3
-rw-r--r--src/third_party/shim_boost.cpp3
-rw-r--r--src/third_party/shim_fmt.cpp3
-rw-r--r--src/third_party/shim_icu.cpp2
-rw-r--r--src/third_party/shim_intel_decimal128.cpp3
-rw-r--r--src/third_party/shim_kms_message.cpp3
-rw-r--r--src/third_party/shim_mozjs.cpp3
-rw-r--r--src/third_party/shim_pcrecpp.cpp3
-rw-r--r--src/third_party/shim_snappy.cpp3
-rw-r--r--src/third_party/shim_stemmer.cpp3
-rw-r--r--src/third_party/shim_timelib.cpp3
-rw-r--r--src/third_party/shim_tomcrypt.cpp3
-rw-r--r--src/third_party/shim_unwind.cpp3
-rw-r--r--src/third_party/shim_v8.cpp3
-rw-r--r--src/third_party/shim_wiredtiger.cpp3
-rw-r--r--src/third_party/shim_yaml.cpp3
-rw-r--r--src/third_party/shim_zlib.cpp3
-rw-r--r--src/third_party/shim_zstd.cpp3
24 files changed, 25 insertions, 82 deletions
diff --git a/SConstruct b/SConstruct
index 9ebf301cf3b..f5b908fbc62 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1264,24 +1264,6 @@ env.AddMethod(mongo_platform.env_os_is_wrapper, 'TargetOSIs')
env.AddMethod(mongo_platform.env_get_os_name_wrapper, 'GetTargetOSName')
-def shim_library(env, name, needs_link=False, *args, **kwargs):
- nodes = env.Library(
- target=f"shim_{name}" if name else name,
- source=[
- f"shim_{name}.cpp" if name else name,
- ],
- *args,
- **kwargs
- )
-
- for n in nodes:
- setattr(n.attributes, "needs_link", needs_link)
-
- return nodes
-
-env.AddMethod(shim_library, 'ShimLibrary')
-
-
def conf_error(env, msg, *args):
print(msg.format(*args))
print("See {0} for details".format(env.File('$CONFIGURELOG').abspath))
diff --git a/site_scons/libdeps_next.py b/site_scons/libdeps_next.py
index 3a7e7a2bac2..ddf1bc93631 100644
--- a/site_scons/libdeps_next.py
+++ b/site_scons/libdeps_next.py
@@ -730,9 +730,7 @@ def _libdeps_visit(n, tsorted, marked, walking, debug=False):
_libdeps_visit_private(child, marked, walking, debug)
marked[n.target_node] = LibdepsVisitationMark.MARKED_PUBLIC
-
- if getattr(n.target_node.attributes, "needs_link", True):
- tsorted.append(n.target_node)
+ tsorted.append(n.target_node)
except DependencyCycleError as e:
if len(e.cycle_nodes) == 1 or e.cycle_nodes[0] != e.cycle_nodes[-1]:
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
index 08b2c2cdc35..c5b21681406 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -223,6 +223,30 @@ env.AddMethod(injectThirdParty, 'InjectThirdParty')
env = env.Clone()
+# Construct an empty object file that we can use to produce the
+# library for every shim. This avoids the need to create and name a
+# different empty source file for every third-party library, as we did
+# in the past.
+
+empty_source=env.Textfile(
+ target='third_party_shim.cpp',
+ source=str(),
+)
+env.Alias('generated-sources', empty_source)
+
+empty_object = env.LibraryObject(
+ target='third_party_shim',
+ source=empty_source,
+)
+
+def shim_library(env, name, **kwargs):
+ return env.Library(
+ target=f"shim_{name}",
+ source=empty_object[0],
+ **kwargs,
+ )
+env.AddMethod(shim_library, 'ShimLibrary')
+
murmurEnv = env.Clone()
murmurEnv.InjectThirdParty(libraries=['fmt'])
murmurEnv.SConscript('murmurhash3/SConscript', exports={ 'env' : murmurEnv })
diff --git a/src/third_party/shim_abseil.cpp b/src/third_party/shim_abseil.cpp
deleted file mode 100644
index 3d06a96631a..00000000000
--- a/src/third_party/shim_abseil.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_abseil.cpp is part of the
-// third_party/abseil-cpp library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_allocator.cpp b/src/third_party/shim_allocator.cpp
deleted file mode 100644
index 777ede8d4a0..00000000000
--- a/src/third_party/shim_allocator.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-// This file intentionally blank. shim_allocator.cpp is part of the third_party/shim_allocator
-// library, used to manage memory allocator selection (tcmalloc, libc, etc.).
diff --git a/src/third_party/shim_asio.cpp b/src/third_party/shim_asio.cpp
deleted file mode 100644
index 3585439556f..00000000000
--- a/src/third_party/shim_asio.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_asio.cpp is part of the
-// third_party/asio library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_benchmark.cpp b/src/third_party/shim_benchmark.cpp
deleted file mode 100644
index e13997f67d3..00000000000
--- a/src/third_party/shim_benchmark.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_benchmark.cpp is part of the
-// third_party/benchmark library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_boost.cpp b/src/third_party/shim_boost.cpp
deleted file mode 100644
index 8478ee6bde3..00000000000
--- a/src/third_party/shim_boost.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_boost.cpp is part of the
-// third_party/boost library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_fmt.cpp b/src/third_party/shim_fmt.cpp
deleted file mode 100644
index 0f3a704961f..00000000000
--- a/src/third_party/shim_fmt.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_fmt.cpp is part of the
-// third_party/fmt library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_icu.cpp b/src/third_party/shim_icu.cpp
deleted file mode 100644
index c1c296e27ca..00000000000
--- a/src/third_party/shim_icu.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-// This file intentionally blank. shim_icu.cpp is part of the third_party/icu library, which is
-// just a placeholder for forwarding library dependencies.
diff --git a/src/third_party/shim_intel_decimal128.cpp b/src/third_party/shim_intel_decimal128.cpp
deleted file mode 100644
index 21977ae9410..00000000000
--- a/src/third_party/shim_intel_decimal128.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_intel_decimal128.cpp is part of the
-// third_party/IntelRDFPMathLib20U1 library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_kms_message.cpp b/src/third_party/shim_kms_message.cpp
deleted file mode 100644
index ce3aa6bb123..00000000000
--- a/src/third_party/shim_kms_message.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_kms_message.cpp is part of the
-// third_party/kms_message library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_mozjs.cpp b/src/third_party/shim_mozjs.cpp
deleted file mode 100644
index c1b9dbe8ec2..00000000000
--- a/src/third_party/shim_mozjs.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_mozjs.cpp is part of the
-// third_party/mozjs library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_pcrecpp.cpp b/src/third_party/shim_pcrecpp.cpp
deleted file mode 100644
index 57d2daac1a8..00000000000
--- a/src/third_party/shim_pcrecpp.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_pcrecpp.cc is part of the
-// third_party/pcrecpp library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_snappy.cpp b/src/third_party/shim_snappy.cpp
deleted file mode 100644
index bf9d7b20437..00000000000
--- a/src/third_party/shim_snappy.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_snappy.cpp is part of the
-// third_party/snappy library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_stemmer.cpp b/src/third_party/shim_stemmer.cpp
deleted file mode 100644
index 43dc23e553e..00000000000
--- a/src/third_party/shim_stemmer.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_stemmer.cpp is part of the
-// third_party/libstemmer_c library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_timelib.cpp b/src/third_party/shim_timelib.cpp
deleted file mode 100644
index e42b710c6ef..00000000000
--- a/src/third_party/shim_timelib.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_timelib.cpp is part of the
-// third_party/timelib library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_tomcrypt.cpp b/src/third_party/shim_tomcrypt.cpp
deleted file mode 100644
index d9fe3e92ccd..00000000000
--- a/src/third_party/shim_tomcrypt.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_tomcrypt.cpp is part of the
-// third_party/tomcrypt library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_unwind.cpp b/src/third_party/shim_unwind.cpp
deleted file mode 100644
index cf14d893fff..00000000000
--- a/src/third_party/shim_unwind.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_unwind.cpp is part of the
-// third_party/unwind library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_v8.cpp b/src/third_party/shim_v8.cpp
deleted file mode 100644
index a4b40a7f736..00000000000
--- a/src/third_party/shim_v8.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_v8.cpp is part of the
-// third_party/v8 library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_wiredtiger.cpp b/src/third_party/shim_wiredtiger.cpp
deleted file mode 100644
index ab1cc40aea1..00000000000
--- a/src/third_party/shim_wiredtiger.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_wiredtiger.cpp is part of the
-// third_party/wiredtiger library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_yaml.cpp b/src/third_party/shim_yaml.cpp
deleted file mode 100644
index a9a63b2d27e..00000000000
--- a/src/third_party/shim_yaml.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_yaml.cpp is part of the
-// third_party/yaml library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_zlib.cpp b/src/third_party/shim_zlib.cpp
deleted file mode 100644
index a3114c19113..00000000000
--- a/src/third_party/shim_zlib.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_zlib.cpp is part of the
-// third_party/zlib library, which is just a placeholder for forwarding
-// library dependencies.
diff --git a/src/third_party/shim_zstd.cpp b/src/third_party/shim_zstd.cpp
deleted file mode 100644
index 6eea5909106..00000000000
--- a/src/third_party/shim_zstd.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file intentionally blank. shim_zstd.cpp is part of the
-// third_party/zstandard library, which is just a placeholder for forwarding
-// library dependencies.