summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2023-06-30 07:56:59 +0200
committerGitHub <noreply@github.com>2023-06-30 07:56:59 +0200
commit38c83f667d291c85f4da53a77fdc1968437150a3 (patch)
tree24359a487cde7ebe688873d00dfe6d74e08d4236
parented3771ced0a66f868eef2e6212e9b69eee2b8429 (diff)
parent1de32aa9ea1f3f4e1fd3f5f9b283ac4dc2befae1 (diff)
downloadfork-godot-webrtc-native-38c83f667d291c85f4da53a77fdc1968437150a3.tar.gz
fork-godot-webrtc-native-38c83f667d291c85f4da53a77fdc1968437150a3.tar.bz2
fork-godot-webrtc-native-38c83f667d291c85f4da53a77fdc1968437150a3.zip
Merge pull request #109 from Faless/fix/linux_static_gcc_cpp
Statically link libgcc and libstdc++ on linux
-rw-r--r--SConstruct12
1 files changed, 12 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index dfd237f..8118948 100644
--- a/SConstruct
+++ b/SConstruct
@@ -118,6 +118,18 @@ if env["platform"] == "macos" and os.environ.get("OSXCROSS_ROOT", ""):
if env["macos_deployment_target"] != "default":
env["ENV"]["MACOSX_DEPLOYMENT_TARGET"] = env["macos_deployment_target"]
+# Patch linux flags to statically link libgcc and libstdc++
+if env["platform"] == "linux":
+ env.Append(
+ LINKFLAGS=[
+ "-Wl,--no-undefined",
+ "-static-libgcc",
+ "-static-libstdc++",
+ ]
+ )
+ # And add some linux dependencies.
+ env.Append(LIBS=["pthread", "dl"])
+
opts.Update(env)
target = env["target"]