Skip to content

Commit

Permalink
Fix SConstruct check for config.is_enabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
neikeq committed Oct 2, 2017
1 parent e36fb95 commit d5caf71
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,12 @@ for x in module_list:
module_enabled = True
tmppath = "./modules/" + x
sys.path.append(tmppath)
try:
import config
if (not config.is_enabled()):
module_enabled = False
except:
pass
import config
enabled_attr = getattr(config, "is_enabled", None)
if (callable(enabled_attr) and not config.is_enabled()):
module_enabled = False
sys.path.remove(tmppath)
sys.modules.pop('config')
opts.Add(BoolVariable('module_' + x + '_enabled', "Enable module '%s'" % (x, ), module_enabled))

opts.Update(env_base) # update environment
Expand Down Expand Up @@ -246,7 +245,7 @@ if selected_platform in platform_list:
env = detect.create(env_base)
else:
env = env_base.Clone()

if env['dev']:
env["warnings"] = "all"
env['verbose'] = True
Expand Down

0 comments on commit d5caf71

Please sign in to comment.