mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Ability to set a module enabled/disabled by default by adding is_enabled() to config.py
This commit is contained in:
parent
0c82d113ed
commit
d3345121cc
1 changed files with 11 additions and 1 deletions
12
SConstruct
12
SConstruct
|
@ -189,7 +189,17 @@ for k in platform_opts.keys():
|
||||||
opts.Add(o)
|
opts.Add(o)
|
||||||
|
|
||||||
for x in module_list:
|
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
|
opts.Update(env_base) # update environment
|
||||||
Help(opts.GenerateHelpText(env_base)) # generate help
|
Help(opts.GenerateHelpText(env_base)) # generate help
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue