diff --git a/SConstruct b/SConstruct index 3e6231cdc2..8b1770a86a 100644 --- a/SConstruct +++ b/SConstruct @@ -136,25 +136,25 @@ opts.Add(EnumVariable('bits', "Target platform bits", 'default', ('default', '32 opts.Add('p', "Platform (alias for 'platform')", '') 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') +opts.Add(BoolVariable('tools', "Build the tools a.k.a. the Godot editor", True)) # Components -opts.Add('deprecated', "Enable deprecated features (yes/no)", 'yes') -opts.Add('gdscript', "Build GDSCript support (yes/no)", 'yes') -opts.Add('minizip', "Build minizip archive support (yes/no)", 'yes') -opts.Add('xaudio2', "XAudio2 audio driver (yes/no)", 'no') -opts.Add('xml', "XML format support for resources (yes/no)", 'yes') +opts.Add(BoolVariable('deprecated', "Enable deprecated features", True)) +opts.Add(BoolVariable('gdscript', "Build GDSCript support", True)) +opts.Add(BoolVariable('minizip', "Build minizip archive support", True)) +opts.Add(BoolVariable('xaudio2', "XAudio2 audio driver", False)) +opts.Add(BoolVariable('xml', "XML format support for resources", True)) # Advanced options -opts.Add('disable_3d', "Disable 3D nodes for smaller executable (yes/no)", 'no') -opts.Add('disable_advanced_gui', "Disable advance 3D gui nodes and behaviors (yes/no)", 'no') +opts.Add(BoolVariable('disable_3d', "Disable 3D nodes for smaller executable", False)) +opts.Add(BoolVariable('disable_advanced_gui', "Disable advance 3D gui nodes and behaviors", False)) opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '') 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(BoolVariable('verbose', "Enable verbose output for the compilation", False)) +opts.Add(BoolVariable('vsproj', "Generate Visual Studio Project.", False)) 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') +opts.Add(BoolVariable('progress', "Show a progress indicator during build", True)) +opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=all", False)) # Thirdparty libraries opts.Add('builtin_enet', "Use the builtin enet library (yes/no)", 'yes') @@ -213,7 +213,7 @@ if (env_base['target'] == 'debug'): env_base.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) env_base.Append(CPPFLAGS=['-DSCI_NAMESPACE']) -if (env_base['deprecated'] == 'no'): +if not env_base['deprecated']: env_base.Append(CPPFLAGS=['-DDISABLE_DEPRECATED']) env_base.platforms = {} @@ -237,11 +237,11 @@ if selected_platform in platform_list: else: env = env_base.Clone() - if (env["dev"] == "yes"): + if env['dev']: env["warnings"] = "all" - env["verbose"] = "yes" + env['verbose'] = True - if env['vsproj'] == "yes": + if env['vsproj']: env.vs_incs = [] env.vs_srcs = [] @@ -319,19 +319,19 @@ if selected_platform in platform_list: suffix = "." + selected_platform if (env["target"] == "release"): - if (env["tools"] == "yes"): + if env["tools"]: print("Tools can only be built with targets 'debug' and 'release_debug'.") sys.exit(255) suffix += ".opt" env.Append(CCFLAGS=['-DNDEBUG']) elif (env["target"] == "release_debug"): - if (env["tools"] == "yes"): + if env["tools"]: suffix += ".opt.tools" else: suffix += ".opt.debug" else: - if (env["tools"] == "yes"): + if env["tools"]: suffix += ".tools" else: suffix += ".debug" @@ -386,22 +386,22 @@ if selected_platform in platform_list: # to test 64 bits compiltion # env.Append(CPPFLAGS=['-m64']) - if (env['tools'] == 'yes'): + if env['tools']: env.Append(CPPFLAGS=['-DTOOLS_ENABLED']) - if (env['disable_3d'] == 'yes'): + if env['disable_3d']: env.Append(CPPFLAGS=['-D_3D_DISABLED']) - if (env['gdscript'] == 'yes'): + if env['gdscript']: env.Append(CPPFLAGS=['-DGDSCRIPT_ENABLED']) - if (env['disable_advanced_gui'] == 'yes'): + if env['disable_advanced_gui']: env.Append(CPPFLAGS=['-DADVANCED_GUI_DISABLED']) - if (env['minizip'] == 'yes'): + if env['minizip']: env.Append(CPPFLAGS=['-DMINIZIP_ENABLED']) - if (env['xml'] == 'yes'): + if env['xml']: env.Append(CPPFLAGS=['-DXML_ENABLED']) - if (env['verbose'] == 'no'): + if not env['verbose']: methods.no_verbose(sys, env) if (True): # FIXME: detect GLES3 @@ -423,7 +423,7 @@ if selected_platform in platform_list: SConscript("platform/" + selected_platform + "/SCsub") # build selected platform # Microsoft Visual Studio Project Generation - if (env['vsproj']) == "yes": + if env['vsproj']: methods.generate_vs_project(env, GetOption("num_jobs")) # Check for the existence of headers @@ -470,7 +470,7 @@ def progress_finish(target, source, env): with open(node_count_fname, 'w') as f: f.write('%d\n' % node_count) -if ('env' in locals() and env["progress"] == "yes"): +if 'env' in locals() and env['progress']: try: with open(node_count_fname) as f: node_count_max = int(f.readline()) diff --git a/drivers/SCsub b/drivers/SCsub index b8bba91378..bdc7dcbb24 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -17,7 +17,7 @@ SConscript('pulseaudio/SCsub') if (env["platform"] == "windows"): SConscript("rtaudio/SCsub") SConscript("wasapi/SCsub") -if (env["xaudio2"] == "yes"): +if env['xaudio2']: SConscript("xaudio2/SCsub") # Graphics drivers @@ -29,10 +29,10 @@ SConscript("png/SCsub") # Tools override # FIXME: Should likely be integrated in the tools/ codebase -if (env["tools"] == "yes"): +if env['tools']: SConscript("convex_decomp/SCsub") -if env['vsproj'] == "yes": +if env['vsproj']: env.AddToVSProject(env.drivers_sources) if env.split_drivers: diff --git a/editor/SCsub b/editor/SCsub index 315865ad32..bf88ebb1b5 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -395,8 +395,8 @@ def _make_doc_data_class_path(to_path): g.write("{NULL,NULL}\n") g.write("};\n") -if (env["tools"] == "yes"): +if env['tools']: # Register exporters reg_exporters_inc = '#include "register_exporters.h"\n' reg_exporters = 'void register_exporters() {\n' diff --git a/modules/etc/config.py b/modules/etc/config.py index 4b0b01b78e..ee719e52b8 100644 --- a/modules/etc/config.py +++ b/modules/etc/config.py @@ -6,6 +6,6 @@ def can_build(platform): def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that - if (env["tools"] == "no"): + if not env['tools']: env["module_etc_enabled"] = "no" env.disabled_modules.append("etc") diff --git a/modules/squish/config.py b/modules/squish/config.py index cc8f098010..2b296389de 100644 --- a/modules/squish/config.py +++ b/modules/squish/config.py @@ -6,6 +6,6 @@ def can_build(platform): def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that - if (env["tools"] == "no"): + if not env['tools']: env["module_squish_enabled"] = "no" env.disabled_modules.append("squish") diff --git a/modules/tinyexr/config.py b/modules/tinyexr/config.py index 2e4b96a6b0..9cbf22cdc6 100644 --- a/modules/tinyexr/config.py +++ b/modules/tinyexr/config.py @@ -6,6 +6,6 @@ def can_build(platform): def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that - if (env["tools"] == "no"): + if not env['tools']: env["module_tinyexr_enabled"] = "no" env.disabled_modules.append("tinyexr") diff --git a/platform/android/detect.py b/platform/android/detect.py index 6640a053fe..67b31e488b 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -32,7 +32,7 @@ def get_opts(): def get_flags(): return [ - ('tools', 'no'), + ('tools', False), ] diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 0b81422fa3..8a44114a51 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -37,7 +37,7 @@ def get_opts(): def get_flags(): return [ - ('tools', 'no'), + ('tools', False), ] diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index bea8f156af..b48a080ce0 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -27,7 +27,7 @@ def get_opts(): def get_flags(): return [ - ('tools', 'no'), + ('tools', False), ('module_theora_enabled', 'no'), ] diff --git a/platform/server/detect.py b/platform/server/detect.py index 5c13297bc6..673245ecff 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -86,7 +86,7 @@ def configure(env): if (env['builtin_enet'] == 'no'): env.ParseConfig('pkg-config libenet --cflags --libs') - if (env['builtin_squish'] == 'no' and env["tools"] == "yes"): + if env['builtin_squish'] == 'no' and env['tools']: env.ParseConfig('pkg-config libsquish --cflags --libs') if env['builtin_zstd'] == 'no': diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py index 23929dd804..af53f97446 100644 --- a/platform/uwp/detect.py +++ b/platform/uwp/detect.py @@ -33,8 +33,8 @@ def get_opts(): def get_flags(): return [ - ('tools', 'no'), - ('xaudio2', 'yes'), + ('tools', False), + ('xaudio2', True), ] diff --git a/platform/windows/SCsub b/platform/windows/SCsub index fd041e096e..d3c160f052 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -30,7 +30,7 @@ common_win.append(obj) binary = env.Program('#bin/godot', ['godot_win.cpp'] + common_win, PROGSUFFIX=env["PROGSUFFIX"]) # Microsoft Visual Studio Project Generation -if (env['vsproj']) == "yes": +if env['vsproj']: env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] for x in common_win: env.vs_srcs = env.vs_srcs + ["platform/windows/" + str(x)] diff --git a/platform/x11/detect.py b/platform/x11/detect.py index be21aa8f8e..1787bb46c4 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -159,7 +159,7 @@ def configure(env): if (env['builtin_enet'] == 'no'): env.ParseConfig('pkg-config libenet --cflags --libs') - if (env['builtin_squish'] == 'no' and env["tools"] == "yes"): + if env['builtin_squish'] == 'no' and env['tools']: env.ParseConfig('pkg-config libsquish --cflags --libs') if env['builtin_zstd'] == 'no': diff --git a/scene/3d/SCsub b/scene/3d/SCsub index 90e78ba8d3..72739b527e 100644 --- a/scene/3d/SCsub +++ b/scene/3d/SCsub @@ -3,7 +3,7 @@ Import('env') -if (env["disable_3d"] == "yes"): +if env['disable_3d']: env.scene_sources.append("3d/spatial.cpp") env.scene_sources.append("3d/skeleton.cpp")