[SCons] Add "optimize" and "debug_symbols" options

optimize = auto|none|debug|speed|size|0|1|2|3
debug_symbol = True|False

optimize == "auto" will produce:
- "debug" for "debug" builds
- "speed" for "release" builds
This commit is contained in:
Fabio Alessandrelli
2022-09-11 19:25:22 +02:00
parent 024b6d2d9e
commit 2bf983e638
8 changed files with 71 additions and 28 deletions

View File

@@ -18,11 +18,6 @@ def generate(env):
env.Append(CCFLAGS=["-fPIC", "-Wwrite-strings"])
env.Append(LINKFLAGS=["-Wl,-R,'$$ORIGIN'"])
if env["target"] == "debug":
env.Append(CCFLAGS=["-Og", "-g"])
elif env["target"] == "release":
env.Append(CCFLAGS=["-O3"])
if env["arch"] == "x86_64":
# -m64 and -m32 are x86-specific already, but it doesn't hurt to
# be clear and also specify -march=x86-64. Similar with 32-bit.