summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-07-05 15:45:51 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-07-05 15:53:52 +0200
commite5279d3d0f8bfccacdd1892cd5d6d8259b83d124 (patch)
tree0332f168449a4786a89d930b9e11a2dafc75fcd1 /SConstruct
parentdbf3a13d0faad856726b96942425e08618aa89d3 (diff)
downloadredot-cpp-e5279d3d0f8bfccacdd1892cd5d6d8259b83d124.tar.gz
Add optimization flags for android and javascript.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct10
1 files changed, 10 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index cfb2e95..9c32c03 100644
--- a/SConstruct
+++ b/SConstruct
@@ -375,6 +375,11 @@ elif env['platform'] == 'android':
env.Append(CCFLAGS=['--target=' + arch_info['target'] + env['android_api_level'], '-march=' + arch_info['march'], '-fPIC'])#, '-fPIE', '-fno-addrsig', '-Oz'])
env.Append(CCFLAGS=arch_info['ccflags'])
+ if env['target'] == 'debug':
+ env.Append(CCFLAGS=['-Og', '-g'])
+ elif env['target'] == 'release':
+ env.Append(CCFLAGS=['-O3'])
+
elif env["platform"] == "javascript":
env["ENV"] = os.environ
env["CC"] = "emcc"
@@ -403,6 +408,11 @@ elif env["platform"] == "javascript":
env.Replace(SHLINKFLAGS='$LINKFLAGS')
env.Replace(SHLINKFLAGS='$LINKFLAGS')
+ if env['target'] == 'debug':
+ env.Append(CCFLAGS=['-O0', '-g'])
+ elif env['target'] == 'release':
+ env.Append(CCFLAGS=['-O3'])
+
env.Append(CPPPATH=[
'.',
env['headers_dir'],