summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-07-09 16:01:47 +0200
committerGitHub <noreply@github.com>2021-07-09 16:01:47 +0200
commit784103f6766f72137b34712ee1883aea992c1ef3 (patch)
tree962ffb7de58dd9526668d0f304e35e57bcd4ff59 /SConstruct
parent98124aafe861bd759c6cfd40395921325a367186 (diff)
parente5279d3d0f8bfccacdd1892cd5d6d8259b83d124 (diff)
downloadredot-cpp-784103f6766f72137b34712ee1883aea992c1ef3.tar.gz
Merge pull request #581 from Faless/build/optimization_flags
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 963ccfc..1943d29 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'],