diff options
author | David Snopek <dsnopek@gmail.com> | 2023-11-24 07:15:52 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-24 07:15:52 -0600 |
commit | 588d869a3ba91ecef8b42303e27066006f5f7d0e (patch) | |
tree | 5e9a1ec3b9d964988433e1e6175c0bec703b1fa9 | |
parent | 5be275d73b4aa50ceb95836b06224fcaed153771 (diff) | |
parent | f5e4f95cde6de04ed9bf6abfd9bf12cc0bac6b1a (diff) | |
download | redot-cpp-588d869a3ba91ecef8b42303e27066006f5f7d0e.tar.gz |
Merge pull request #1313 from DmitriySalnikov/visibility_hidden
[Scons] Added the ability to change the visibility of symbols
-rw-r--r-- | tools/godotcpp.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/godotcpp.py b/tools/godotcpp.py index fcf4dd7..e445cad 100644 --- a/tools/godotcpp.py +++ b/tools/godotcpp.py @@ -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 for pl in platforms: tool = Tool(pl, toolpath=["tools"]) @@ -269,6 +278,14 @@ def generate(env): elif env.get("is_msvc", False): 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 if env.get("is_msvc", False): env.Append(CXXFLAGS=["/std:c++17"]) |