Merge pull request #1313 from DmitriySalnikov/visibility_hidden
[Scons] Added the ability to change the visibility of symbolspull/1319/head
commit
588d869a3b
|
@ -189,6 +189,15 @@ def options(opts, env):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
opts.Add(
|
||||||
|
EnumVariable(
|
||||||
|
key="symbols_visibility",
|
||||||
|
help="Symbols visibility on GNU platforms. Use 'auto' to apply the default value.",
|
||||||
|
default=env.get("symbols_visibility", "hidden"),
|
||||||
|
allowed_values=["auto", "visible", "hidden"],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# Add platform options
|
# Add platform options
|
||||||
for pl in platforms:
|
for pl in platforms:
|
||||||
tool = Tool(pl, toolpath=["tools"])
|
tool = Tool(pl, toolpath=["tools"])
|
||||||
|
@ -269,6 +278,14 @@ def generate(env):
|
||||||
elif env.get("is_msvc", False):
|
elif env.get("is_msvc", False):
|
||||||
env.Append(CXXFLAGS=["/EHsc"])
|
env.Append(CXXFLAGS=["/EHsc"])
|
||||||
|
|
||||||
|
if not env.get("is_msvc", False):
|
||||||
|
if env["symbols_visibility"] == "visible":
|
||||||
|
env.Append(CCFLAGS=["-fvisibility=default"])
|
||||||
|
env.Append(LINKFLAGS=["-fvisibility=default"])
|
||||||
|
elif env["symbols_visibility"] == "hidden":
|
||||||
|
env.Append(CCFLAGS=["-fvisibility=hidden"])
|
||||||
|
env.Append(LINKFLAGS=["-fvisibility=hidden"])
|
||||||
|
|
||||||
# Require C++17
|
# Require C++17
|
||||||
if env.get("is_msvc", False):
|
if env.get("is_msvc", False):
|
||||||
env.Append(CXXFLAGS=["/std:c++17"])
|
env.Append(CXXFLAGS=["/std:c++17"])
|
||||||
|
|
Loading…
Reference in New Issue