summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SConstruct37
1 files changed, 15 insertions, 22 deletions
diff --git a/SConstruct b/SConstruct
index 47a039fb14..b7809dfe42 100644
--- a/SConstruct
+++ b/SConstruct
@@ -259,13 +259,16 @@ opts.Add(BoolVariable("builtin_zlib", "Use the built-in zlib library", True))
opts.Add(BoolVariable("builtin_zstd", "Use the built-in Zstd library", True))
# Compilation environment setup
-opts.Add("CXX", "C++ compiler")
-opts.Add("CC", "C compiler")
-opts.Add("LINK", "Linker")
-opts.Add("CCFLAGS", "Custom flags for both the C and C++ compilers")
-opts.Add("CFLAGS", "Custom flags for the C compiler")
-opts.Add("CXXFLAGS", "Custom flags for the C++ compiler")
-opts.Add("LINKFLAGS", "Custom flags for the linker")
+# CXX, CC, and LINK directly set the equivalent `env` values (which may still
+# be overridden for a specific platform), the lowercase ones are appended.
+opts.Add("CXX", "C++ compiler binary")
+opts.Add("CC", "C compiler binary")
+opts.Add("LINK", "Linker binary")
+opts.Add("cppdefines", "Custom defines for the pre-processor")
+opts.Add("ccflags", "Custom flags for both the C and C++ compilers")
+opts.Add("cxxflags", "Custom flags for the C++ compiler")
+opts.Add("cflags", "Custom flags for the C compiler")
+opts.Add("linkflags", "Custom flags for the linker")
# Update the environment to have all above options defined
# in following code (especially platform and custom_modules).
@@ -507,21 +510,11 @@ if selected_platform in platform_list:
env.extra_suffix += "." + env["extra_suffix"]
# Environment flags
- CCFLAGS = env.get("CCFLAGS", "")
- env["CCFLAGS"] = ""
- env.Append(CCFLAGS=str(CCFLAGS).split())
-
- CFLAGS = env.get("CFLAGS", "")
- env["CFLAGS"] = ""
- env.Append(CFLAGS=str(CFLAGS).split())
-
- CXXFLAGS = env.get("CXXFLAGS", "")
- env["CXXFLAGS"] = ""
- env.Append(CXXFLAGS=str(CXXFLAGS).split())
-
- LINKFLAGS = env.get("LINKFLAGS", "")
- env["LINKFLAGS"] = ""
- env.Append(LINKFLAGS=str(LINKFLAGS).split())
+ env.Append(CPPDEFINES=env.get("cppdefines", "").split())
+ env.Append(CCFLAGS=env.get("ccflags", "").split())
+ env.Append(CXXFLAGS=env.get("cxxflags", "").split())
+ env.Append(CFLAGS=env.get("cflags", "").split())
+ env.Append(LINKFLAGS=env.get("linkflags", "").split())
# Feature build profile
disabled_classes = []