diff options
author | Rafał Mikrut <mikrutrafal@protonmail.com> | 2021-03-13 15:29:55 +0100 |
---|---|---|
committer | Rafał Mikrut <mikrutrafal@protonmail.com> | 2021-03-14 15:51:05 +0100 |
commit | 0b298d201e6010daff369821951c67fbb4e63a10 (patch) | |
tree | 339bf5d4ca0f4e0b6ea95c45dcc4394adcb4963a /platform/javascript | |
parent | 942f5f0cb282cbc2b3fb766e3c7614e82b98dd9b (diff) |
Allow to not optimize release build
Diffstat (limited to 'platform/javascript')
-rw-r--r-- | platform/javascript/detect.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index e80ef374ec..ac8d8de7e0 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -64,21 +64,21 @@ def configure(env): sys.exit(255) ## Build type - if env["target"] == "release": + if env["target"].startswith("release"): # Use -Os to prioritize optimizing for reduced file size. This is # particularly valuable for the web platform because it directly # decreases download time. # -Os reduces file size by around 5 MiB over -O3. -Oz only saves about # 100 KiB over -Os, which does not justify the negative impact on # run-time performance. - env.Append(CCFLAGS=["-Os"]) - env.Append(LINKFLAGS=["-Os"]) - elif env["target"] == "release_debug": - env.Append(CCFLAGS=["-Os"]) - env.Append(LINKFLAGS=["-Os"]) - env.Append(CPPDEFINES=["DEBUG_ENABLED"]) - # Retain function names for backtraces at the cost of file size. - env.Append(LINKFLAGS=["--profiling-funcs"]) + if env["optimize"] != "none": + env.Append(CCFLAGS=["-Os"]) + env.Append(LINKFLAGS=["-Os"]) + + if env["target"] == "release_debug": + env.Append(CPPDEFINES=["DEBUG_ENABLED"]) + # Retain function names for backtraces at the cost of file size. + env.Append(LINKFLAGS=["--profiling-funcs"]) else: # "debug" env.Append(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(CCFLAGS=["-O1", "-g"]) |