summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-09-11 19:25:22 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-09-12 16:52:05 +0200
commit2bf983e6382f5236948f7740faf130a3568f9dd0 (patch)
tree6e877051c4b419eee813aabcd47f77129bfcf00c /SConstruct
parent024b6d2d9e6bb6ed8b2c1641330ae444e6c6ba7a (diff)
downloadredot-cpp-2bf983e6382f5236948f7740faf130a3568f9dd0.tar.gz
[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
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct5
1 files changed, 5 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index ef1a92a..aed5f06 100644
--- a/SConstruct
+++ b/SConstruct
@@ -102,6 +102,10 @@ architecture_aliases = {
}
opts.Add(EnumVariable("arch", "CPU architecture", "", architecture_array, architecture_aliases))
+# Targets flags tool (optimizations, debug symbols)
+target_tool = Tool("targets", toolpath=["tools"])
+target_tool.options(opts)
+
opts.Update(env)
Help(opts.GenerateHelpText(env))
@@ -135,6 +139,7 @@ if tool is None or not tool.exists(env):
raise ValueError("Required toolchain not found for platform " + env["platform"])
tool.generate(env)
+target_tool.generate(env)
# Detect and print a warning listing unknown SCons variables to ease troubleshooting.
unknown = opts.UnknownVariables()