summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2021-06-21 23:24:01 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-22 21:43:03 +0000
commite3ba5a35ed20eebe21dedcad2ceb021b467bf2cc (patch)
tree14e39c5cfa62063fdffd663b1139365b16aec1a2 /SConstruct
parent686dad084a738a44c2a298a98a21bdb81f0fe683 (diff)
downloadmongo-e3ba5a35ed20eebe21dedcad2ceb021b467bf2cc.tar.gz
SERVER-57396 promote visibility from experimental status
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct18
1 files changed, 11 insertions, 7 deletions
diff --git a/SConstruct b/SConstruct
index 23cff6f9da5..8376ed051eb 100644
--- a/SConstruct
+++ b/SConstruct
@@ -636,11 +636,11 @@ add_option('libdeps-linting',
type='choice',
)
-add_option('experimental-visibility-support',
- choices=['on', 'off'],
- const='on',
- default='off',
- help='Enable visibility annotations (experimental)',
+add_option('visibility-support',
+ choices=['auto', 'on', 'off'],
+ const='auto',
+ default='auto',
+ help='Enable visibility annotations',
nargs='?',
type='choice',
)
@@ -1618,10 +1618,14 @@ if use_system_libunwind and not use_libunwind:
if use_libunwind == True:
env.SetConfigHeaderDefine("MONGO_CONFIG_USE_LIBUNWIND")
+if get_option('visibility-support') == 'auto':
+ visibility_annotations_enabled = (not env.TargetOSIs('windows') and link_model.startswith("dynamic"))
+else:
+ visibility_annotations_enabled = get_option('visibility-support') == 'on'
# Windows can't currently support anything other than 'object' or 'static', until
# we have annotated functions for export.
-if env.TargetOSIs('windows') and get_option('experimental-visibility-support') != 'on':
+if env.TargetOSIs('windows') and not visibility_annotations_enabled:
if link_model not in ['object', 'static', 'dynamic-sdk']:
env.FatalError("Windows builds must use the 'object', 'dynamic-sdk', or 'static' link models")
@@ -1648,7 +1652,7 @@ for builder in ['SharedObject', 'StaticObject']:
if link_model.startswith("dynamic"):
- if link_model == "dynamic" and get_option('experimental-visibility-support') == 'on':
+ if link_model == "dynamic" and visibility_annotations_enabled:
def visibility_cppdefines_generator(target, source, env, for_signature):
if not 'MONGO_API_NAME' in env: