summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-10-01 08:51:30 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-10-01 08:52:11 -0300
commitd3345121ccf12eb5f11f4200b3b4ddc92823817c (patch)
tree7f2c44e314af30e9ef3bc3b37d4ba8537f1b74a0 /SConstruct
parent0c82d113edc4f7cc1bef11c2e03b2a1b39de90fb (diff)
Ability to set a module enabled/disabled by default by adding is_enabled() to config.py
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct12
1 files changed, 11 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 4fd1b86f54..190ef93b9d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -189,7 +189,17 @@ for k in platform_opts.keys():
opts.Add(o)
for x in module_list:
- opts.Add(BoolVariable('module_' + x + '_enabled', "Enable module '%s'" % (x, ), True))
+ module_enabled = True
+ tmppath = "./modules/" + x
+ sys.path.append(tmppath)
+ try:
+ import config
+ if (not config.is_enabled()):
+ module_enabled = False
+ except:
+ pass
+ sys.path.remove(tmppath)
+ opts.Add(BoolVariable('module_' + x + '_enabled', "Enable module '%s'" % (x, ), module_enabled))
opts.Update(env_base) # update environment
Help(opts.GenerateHelpText(env_base)) # generate help