Use EnumVariable for choice-based build options.
This commit is contained in:
parent
0a6446ff36
commit
f9e463bce2
6 changed files with 15 additions and 10 deletions
10
SConstruct
10
SConstruct
|
@ -132,10 +132,10 @@ opts = Variables(customs, ARGUMENTS)
|
|||
|
||||
# Target build options
|
||||
opts.Add('arch', "Platform-dependent architecture (arm/arm64/x86/x64/mips/etc)", '')
|
||||
opts.Add('bits', "Target platform bits (default/32/64/fat)", 'default')
|
||||
opts.Add(EnumVariable('bits', "Target platform bits", 'default', ('default', '32', '64', 'fat')))
|
||||
opts.Add('p', "Platform (alias for 'platform')", '')
|
||||
opts.Add('platform', "Target platform: any in " + str(platform_list), '')
|
||||
opts.Add('target', "Compilation target (debug/release_debug/release)", 'debug')
|
||||
opts.Add('platform', "Target platform (%s)" % ('|'.join(platform_list), ), '')
|
||||
opts.Add(EnumVariable('target', "Compilation target", 'debug', ('debug', 'release_debug', 'release')))
|
||||
opts.Add('tools', "Build the tools a.k.a. the Godot editor (yes/no)", 'yes')
|
||||
|
||||
# Components
|
||||
|
@ -152,7 +152,7 @@ opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all
|
|||
opts.Add('unix_global_settings_path', "UNIX-specific path to system-wide settings. Currently only used for templates", '')
|
||||
opts.Add('verbose', "Enable verbose output for the compilation (yes/no)", 'no')
|
||||
opts.Add('vsproj', "Generate Visual Studio Project. (yes/no)", 'no')
|
||||
opts.Add('warnings', "Set the level of warnings emitted during compilation (extra/all/moderate/no)", 'no')
|
||||
opts.Add(EnumVariable('warnings', "Set the level of warnings emitted during compilation", 'no', ('extra', 'all', 'moderate', 'no')))
|
||||
opts.Add('progress', "Show a progress indicator during build (yes/no)", 'yes')
|
||||
opts.Add('dev', "If yes, alias for verbose=yes warnings=all (yes/no)", 'no')
|
||||
|
||||
|
@ -186,7 +186,7 @@ opts.Add("LINKFLAGS", "Custom flags for the linker")
|
|||
for k in platform_opts.keys():
|
||||
opt_list = platform_opts[k]
|
||||
for o in opt_list:
|
||||
opts.Add(o[0], o[1], o[2])
|
||||
opts.Add(o)
|
||||
|
||||
for x in module_list:
|
||||
opts.Add('module_' + x + '_enabled', "Enable module '" + x + "' (yes/no)", "yes")
|
||||
|
|
|
@ -18,11 +18,12 @@ def can_build():
|
|||
|
||||
|
||||
def get_opts():
|
||||
from SCons.Variables import EnumVariable
|
||||
|
||||
return [
|
||||
('ANDROID_NDK_ROOT', 'Path to the Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)),
|
||||
('ndk_platform', 'Target platform (android-<api>, e.g. "android-18")', "android-18"),
|
||||
('android_arch', 'Target architecture (armv7/armv6/arm64v8/x86)', "armv7"),
|
||||
EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86')),
|
||||
('android_neon', 'Enable NEON support (armv7 only)', "yes"),
|
||||
('android_stl', 'Enable Android STL support (for modules)', "no")
|
||||
]
|
||||
|
|
|
@ -19,9 +19,10 @@ def can_build():
|
|||
|
||||
|
||||
def get_opts():
|
||||
from SCons.Variables import EnumVariable
|
||||
|
||||
return [
|
||||
('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes')
|
||||
EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -19,10 +19,11 @@ def can_build():
|
|||
|
||||
|
||||
def get_opts():
|
||||
from SCons.Variables import EnumVariable
|
||||
|
||||
return [
|
||||
('osxcross_sdk', 'OSXCross SDK version', 'darwin14'),
|
||||
('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes'),
|
||||
EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ def can_build():
|
|||
|
||||
|
||||
def get_opts():
|
||||
from SCons.Variables import EnumVariable
|
||||
|
||||
mingw32 = ""
|
||||
mingw64 = ""
|
||||
|
@ -65,7 +66,7 @@ def get_opts():
|
|||
('mingw_prefix_32', 'MinGW prefix (Win32)', mingw32),
|
||||
('mingw_prefix_64', 'MinGW prefix (Win64)', mingw64),
|
||||
('use_lto', 'Use link time optimization (when using MingW)', 'no'),
|
||||
('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes')
|
||||
EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ def can_build():
|
|||
return True
|
||||
|
||||
def get_opts():
|
||||
from SCons.Variables import EnumVariable
|
||||
|
||||
return [
|
||||
('use_llvm', 'Use the LLVM compiler', 'no'),
|
||||
|
@ -54,7 +55,7 @@ def get_opts():
|
|||
('use_lto', 'Use link time optimization', 'no'),
|
||||
('pulseaudio', 'Detect & use pulseaudio', 'yes'),
|
||||
('udev', 'Use udev for gamepad connection callbacks', 'no'),
|
||||
('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes')
|
||||
EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),
|
||||
]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue