-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide unused symbols in unix libraries
manually added android ndk r23
- Loading branch information
1 parent
725c92f
commit 4b0586f
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
diff --git a/tools/godotcpp.py b/tools/godotcpp.py | ||
index efe632a..46d64fb 100644 | ||
--- a/tools/godotcpp.py | ||
+++ b/tools/godotcpp.py | ||
@@ -183,6 +183,15 @@ def options(opts, env): | ||
) | ||
) | ||
|
||
+ opts.Add( | ||
+ EnumVariable( | ||
+ key="symbols_visibility", | ||
+ help="Symbols visibility on GNU platforms. Use 'auto' to apply the default values.", | ||
+ default=env.get("symbols_visibility", "hidden"), | ||
+ allowed_values=["auto", "visible", "hidden"], | ||
+ ) | ||
+ ) | ||
+ | ||
# Add platform options | ||
for pl in platforms: | ||
tool = Tool(pl, toolpath=["tools"]) | ||
@@ -258,6 +267,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"]) |