Skip to content

Commit 1fbc0c5

Browse files
committed
[Buildsystem] Add EnumVariable(ignorecase=2)
1 parent ce94b26 commit 1fbc0c5

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

SConstruct

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,27 +159,38 @@ opts = Variables(customs, ARGUMENTS)
159159

160160
# Target build options
161161
opts.Add((["platform", "p"], "Target platform (%s)" % "|".join(platform_list), ""))
162-
opts.Add(EnumVariable("target", "Compilation target", "editor", ("editor", "template_release", "template_debug")))
163-
opts.Add(EnumVariable("arch", "CPU architecture", "auto", ["auto"] + architectures, architecture_aliases))
162+
opts.Add(
163+
EnumVariable(
164+
"target", "Compilation target", "editor", ["editor", "template_release", "template_debug"], ignorecase=2
165+
)
166+
)
167+
opts.Add(EnumVariable("arch", "CPU architecture", "auto", ["auto"] + architectures, architecture_aliases, ignorecase=2))
164168
opts.Add(BoolVariable("dev_build", "Developer build with dev-only debugging code (DEV_ENABLED)", False))
165169
opts.Add(
166170
EnumVariable(
167171
"optimize",
168172
"Optimization level (by default inferred from 'target' and 'dev_build')",
169173
"auto",
170-
("auto", "none", "custom", "debug", "speed", "speed_trace", "size", "size_extra"),
174+
["auto", "none", "custom", "debug", "speed", "speed_trace", "size", "size_extra"],
175+
ignorecase=2,
171176
)
172177
)
173178
opts.Add(BoolVariable("debug_symbols", "Build with debugging symbols", False))
174179
opts.Add(BoolVariable("separate_debug_symbols", "Extract debugging symbols to a separate file", False))
175180
opts.Add(BoolVariable("debug_paths_relative", "Make file paths in debug symbols relative (if supported)", False))
176-
opts.Add(EnumVariable("lto", "Link-time optimization (production builds)", "none", ("none", "auto", "thin", "full")))
181+
opts.Add(
182+
EnumVariable(
183+
"lto", "Link-time optimization (production builds)", "none", ["none", "auto", "thin", "full"], ignorecase=2
184+
)
185+
)
177186
opts.Add(BoolVariable("production", "Set defaults to build Godot for use in production", False))
178187
opts.Add(BoolVariable("threads", "Enable threading support", True))
179188

180189
# Components
181190
opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", True))
182-
opts.Add(EnumVariable("precision", "Set the floating-point precision level", "single", ("single", "double")))
191+
opts.Add(
192+
EnumVariable("precision", "Set the floating-point precision level", "single", ["single", "double"], ignorecase=2)
193+
)
183194
opts.Add(BoolVariable("minizip", "Enable ZIP archive support using minizip", True))
184195
opts.Add(BoolVariable("brotli", "Enable Brotli for decompression and WOFF2 fonts support", True))
185196
opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver on supported platforms", False))
@@ -213,7 +224,9 @@ opts.Add(
213224
)
214225
opts.Add(BoolVariable("verbose", "Enable verbose output for the compilation", False))
215226
opts.Add(BoolVariable("progress", "Show a progress indicator during compilation", True))
216-
opts.Add(EnumVariable("warnings", "Level of compilation warnings", "all", ("extra", "all", "moderate", "no")))
227+
opts.Add(
228+
EnumVariable("warnings", "Level of compilation warnings", "all", ["extra", "all", "moderate", "no"], ignorecase=2)
229+
)
217230
opts.Add(BoolVariable("werror", "Treat compiler warnings as errors", False))
218231
opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all generated binary files", "")
219232
opts.Add("object_prefix", "Custom prefix added to the base filename of all generated object files", "")

platform/linuxbsd/detect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_opts():
3030
from SCons.Variables import BoolVariable, EnumVariable
3131

3232
return [
33-
EnumVariable("linker", "Linker program", "default", ("default", "bfd", "gold", "lld", "mold")),
33+
EnumVariable("linker", "Linker program", "default", ["default", "bfd", "gold", "lld", "mold"], ignorecase=2),
3434
BoolVariable("use_llvm", "Use the LLVM compiler", False),
3535
BoolVariable("use_static_cpp", "Link libgcc and libstdc++ statically for better portability", True),
3636
BoolVariable("use_coverage", "Test Godot coverage", False),

platform/macos/detect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_opts():
3131
("osxcross_sdk", "OSXCross SDK version", "darwin16"),
3232
("MACOS_SDK_PATH", "Path to the macOS SDK", ""),
3333
("vulkan_sdk_path", "Path to the Vulkan SDK", ""),
34-
EnumVariable("macports_clang", "Build using Clang from MacPorts", "no", ("no", "5.0", "devel")),
34+
EnumVariable("macports_clang", "Build using Clang from MacPorts", "no", ["no", "5.0", "devel"], ignorecase=2),
3535
BoolVariable("use_ubsan", "Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)", False),
3636
BoolVariable("use_asan", "Use LLVM/GCC compiler address sanitizer (ASAN)", False),
3737
BoolVariable("use_tsan", "Use LLVM/GCC compiler thread sanitizer (TSAN)", False),

platform/windows/detect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def get_opts():
190190
"Targeted Windows version, >= 0x0601 (Windows 7)",
191191
"0x0601",
192192
),
193-
EnumVariable("windows_subsystem", "Windows subsystem", "gui", ("gui", "console")),
193+
EnumVariable("windows_subsystem", "Windows subsystem", "gui", ["gui", "console"], ignorecase=2),
194194
("msvc_version", "MSVC version to use. Handled automatically by SCons if omitted.", ""),
195195
BoolVariable("use_mingw", "Use the Mingw compiler, even if MSVC is installed.", False),
196196
BoolVariable("use_llvm", "Use the LLVM compiler", False),

0 commit comments

Comments
 (0)