summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-07-02 21:58:44 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-07-02 21:58:44 +0200
commitcf98eb2e7a7f171ae8afdaf4e033f46dee73fe5e (patch)
tree89c73d65b3965d2bb856ed22d374feb54961b4f3 /SConstruct
parent7b92ab2a7bb2c12606d5157fd4d10cd384e02761 (diff)
downloadfork-godot-webrtc-native-cf98eb2e7a7f171ae8afdaf4e033f46dee73fe5e.tar.gz
fork-godot-webrtc-native-cf98eb2e7a7f171ae8afdaf4e033f46dee73fe5e.tar.bz2
fork-godot-webrtc-native-cf98eb2e7a7f171ae8afdaf4e033f46dee73fe5e.zip
Fix osx, android optimization flags.
Will need to be also fixed in upstream godot-cpp.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct14
1 files changed, 12 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index c35bb85..dc3f9dd 100644
--- a/SConstruct
+++ b/SConstruct
@@ -141,7 +141,12 @@ elif target_platform == 'windows':
elif target_arch == '64':
env['CXX']='x86_64-w64-mingw32-g++'
- env.Append(CCFLAGS = [ '-g', '-O3', '-std=c++14', '-Wwrite-strings' ])
+ if env['target'] == 'debug':
+ env.Append(CCFLAGS=['-Og', '-g'])
+ elif env['target'] == 'release':
+ env.Append(CCFLAGS=['-O3'])
+
+ env.Append(CCFLAGS = [ '-std=c++14', '-Wwrite-strings' ])
env.Append(LINKFLAGS = [ '--static', '-Wl,--no-undefined', '-static-libgcc', '-static-libstdc++' ])
elif target_platform == 'osx':
@@ -151,7 +156,7 @@ elif target_platform == 'osx':
# Only 64-bits is supported for OS X
target_arch = '64'
- env.Append(CCFLAGS = [ '-g','-O3', '-std=c++14', '-arch', 'x86_64' ])
+ env.Append(CCFLAGS = [ '-std=c++14', '-arch', 'x86_64' ])
env.Append(LINKFLAGS = [ '-arch', 'x86_64', '-framework', 'Cocoa', '-Wl,-undefined,dynamic_lookup' ])
if env['target'] == 'debug':
@@ -248,6 +253,11 @@ elif target_platform == 'android':
env.Append(CCFLAGS=arch_info['ccflags'])
env.Append(LINKFLAGS=['--target=' + arch_info['target'] + env['android_api_level'], '-march=' + arch_info['march']])
+ if env['target'] == 'debug':
+ env.Append(CCFLAGS=['-Og', '-g'])
+ elif env['target'] == 'release':
+ env.Append(CCFLAGS=['-O3'])
+
else:
print("No valid target platform selected.")
sys.exit(1)