Browse Source

Use BoolVariable for module options.

Elliott Sales de Andrade 8 years ago
parent
commit
5be675eb03

+ 2 - 2
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)

+ 1 - 1
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")

+ 1 - 1
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")

+ 1 - 1
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")

+ 1 - 1
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"

+ 1 - 1
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"])

+ 2 - 2
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"