From e5279d3d0f8bfccacdd1892cd5d6d8259b83d124 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 5 Jul 2021 15:45:51 +0200 Subject: [PATCH] Add optimization flags for android and javascript. --- SConstruct | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SConstruct b/SConstruct index cfb2e953..9c32c03a 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'],