diff options
author | totlmstr <totlmstr@gmail.com> | 2020-08-04 00:22:30 -0700 |
---|---|---|
committer | totlmstr <totlmstr@gmail.com> | 2021-04-10 14:17:20 -0700 |
commit | 634ed3e1289ba2b3551b616cddc9a4547cdb57dc (patch) | |
tree | e940c1e7ea1002569c076daf95bc612a2fd41e92 | |
parent | d3c492b7d4a38c3a68d52e9224d432bd1e05660a (diff) |
Add option modules_enabled_by_default
-rw-r--r-- | SConstruct | 26 | ||||
-rw-r--r-- | main/main.cpp | 2 |
2 files changed, 17 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct index 3edf81129b..2d9802f293 100644 --- a/SConstruct +++ b/SConstruct @@ -137,6 +137,7 @@ opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False)) opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False)) opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False)) +opts.Add(BoolVariable("modules_enabled_by_default", "If no, disable all modules except ones explicitly enabled", True)) opts.Add(BoolVariable("no_editor_splash", "Don't use the custom splash screen for the editor", False)) opts.Add("system_certs_path", "Use this path as SSL certificates default for editor (for package maintainers)", "") opts.Add(BoolVariable("use_precise_math_checks", "Math checks use very precise epsilon (debug option)", False)) @@ -259,16 +260,21 @@ for path in module_search_paths: # Add module options. for name, path in modules_detected.items(): - enabled = True - sys.path.insert(0, path) - import config - - try: - enabled = config.is_enabled() - except AttributeError: - pass - sys.path.remove(path) - sys.modules.pop("config") + if env_base["modules_enabled_by_default"]: + enabled = True + + sys.path.insert(0, path) + import config + + try: + enabled = config.is_enabled() + except AttributeError: + pass + sys.path.remove(path) + sys.modules.pop("config") + else: + enabled = False + opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled)) methods.write_modules(modules_detected) diff --git a/main/main.cpp b/main/main.cpp index 4103fad17c..d64e8c5a20 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -375,8 +375,8 @@ void Main::print_help(const char *p_binary) { #ifdef TESTS_ENABLED OS::get_singleton()->print(" --test [--help] Run unit tests. Use --test --help for more information.\n"); #endif - OS::get_singleton()->print("\n"); #endif + OS::get_singleton()->print("\n"); } #ifdef TESTS_ENABLED |