[Scons] Added the ability to change the visibility of symbols
(cherry picked from commit f5e4f95cde
)
pull/1491/head
parent
32becf6a13
commit
5f864cd8de
|
@ -39,6 +39,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"])
|
||||||
|
|
||||||
# Set optimize and debug_symbols flags.
|
# Set optimize and debug_symbols flags.
|
||||||
# "custom" means do nothing and let users set their own optimization flags.
|
# "custom" means do nothing and let users set their own optimization flags.
|
||||||
if env.get("is_msvc", False):
|
if env.get("is_msvc", False):
|
||||||
|
|
|
@ -291,6 +291,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"],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
opts.Add(
|
opts.Add(
|
||||||
EnumVariable(
|
EnumVariable(
|
||||||
"optimize",
|
"optimize",
|
||||||
|
|
Loading…
Reference in New Issue