From 5be675eb0332ccf660a81df51701146997ef9fcb Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 25 Sep 2017 00:27:32 -0400 Subject: [PATCH] Use BoolVariable for module options. --- SConstruct | 4 ++-- modules/etc/config.py | 2 +- modules/squish/config.py | 2 +- modules/tinyexr/config.py | 2 +- platform/android/detect.py | 2 +- platform/iphone/detect.py | 2 +- platform/javascript/detect.py | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SConstruct b/SConstruct index 1d7b91e907b..4fd1b86f54e 100644 --- a/SConstruct +++ b/SConstruct @@ -189,7 +189,7 @@ for k in platform_opts.keys(): opts.Add(o) for x in module_list: - opts.Add('module_' + x + '_enabled', "Enable module '" + x + "' (yes/no)", "yes") + opts.Add(BoolVariable('module_' + x + '_enabled', "Enable module '%s'" % (x, ), True)) opts.Update(env_base) # update environment Help(opts.GenerateHelpText(env_base)) # generate help @@ -359,7 +359,7 @@ if selected_platform in platform_list: env.doc_class_path={} for x in module_list: - if env['module_' + x + '_enabled'] != "yes": + if not env['module_' + x + '_enabled']: continue tmppath = "./modules/" + x sys.path.append(tmppath) diff --git a/modules/etc/config.py b/modules/etc/config.py index ee719e52b8d..7dc2cb59c1c 100644 --- a/modules/etc/config.py +++ b/modules/etc/config.py @@ -7,5 +7,5 @@ def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that if not env['tools']: - env["module_etc_enabled"] = "no" + env['module_etc_enabled'] = False env.disabled_modules.append("etc") diff --git a/modules/squish/config.py b/modules/squish/config.py index 2b296389de0..9b7729bda46 100644 --- a/modules/squish/config.py +++ b/modules/squish/config.py @@ -7,5 +7,5 @@ def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that if not env['tools']: - env["module_squish_enabled"] = "no" + env['module_squish_enabled'] = False env.disabled_modules.append("squish") diff --git a/modules/tinyexr/config.py b/modules/tinyexr/config.py index 9cbf22cdc62..3e16fd725ef 100644 --- a/modules/tinyexr/config.py +++ b/modules/tinyexr/config.py @@ -7,5 +7,5 @@ def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that if not env['tools']: - env["module_tinyexr_enabled"] = "no" + env['module_tinyexr_enabled'] = False env.disabled_modules.append("tinyexr") diff --git a/platform/android/detect.py b/platform/android/detect.py index 67b31e488bb..0a031fe0b1b 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -244,7 +244,7 @@ def configure(env): env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z', 'dl']) # TODO: Move that to opus module's config - if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): + if 'module_opus_enabled' in env and env['module_opus_enabled']: if (env["android_arch"] == "armv6" or env["android_arch"] == "armv7"): env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) env.opus_fixed_point = "yes" diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 8a44114a519..d763b4b6c32 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -151,7 +151,7 @@ def configure(env): env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DMPC_FIXED_POINT']) # TODO: Move that to opus module's config - if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): + if 'module_opus_enabled' in env and env['module_opus_enabled']: env.opus_fixed_point = "yes" if (env["arch"] == "arm"): env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index b48a080ce01..fdcdc7da6fc 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -28,7 +28,7 @@ def get_flags(): return [ ('tools', False), - ('module_theora_enabled', 'no'), + ('module_theora_enabled', False), ] @@ -116,5 +116,5 @@ def configure(env): env.Append(LINKFLAGS=['--memory-init-file', '1']) # TODO: Move that to opus module's config - if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): + if 'module_opus_enabled' in env and env['module_opus_enabled']: env.opus_fixed_point = "yes"