[3.x] Add option modules_enabled_by_default and minimal CI build

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: aaronfranke <arnfranke@yahoo.com>
This commit is contained in:
totlmstr 2024-01-05 18:48:06 -06:00 committed by Aaron Franke
parent ea68c2bfab
commit cae1844c5c
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
2 changed files with 19 additions and 5 deletions

View file

@ -48,6 +48,14 @@ jobs:
build-mono: false build-mono: false
artifact: true artifact: true
- name: Minimal template (target=release, tools=no, everything disabled)
cache-name: linux-template-minimal
target: release
tools: false
sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no debug_symbols=no
build-mono: false
artifact: false
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View file

@ -154,6 +154,7 @@ opts.Add(
) )
opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", 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("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", True)) opts.Add(BoolVariable("no_editor_splash", "Don't use the custom splash screen for the editor", True))
opts.Add("system_certs_path", "Use this path as SSL certificates default for editor (for package maintainers)", "") 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)) opts.Add(BoolVariable("use_precise_math_checks", "Math checks use very precise epsilon (debug option)", False))
@ -302,16 +303,21 @@ for path in module_search_paths:
# Add module options # Add module options
for name, path in modules_detected.items(): for name, path in modules_detected.items():
enabled = True
sys.path.insert(0, path) sys.path.insert(0, path)
import config import config
try: if env_base["modules_enabled_by_default"]:
enabled = config.is_enabled() enabled = True
except AttributeError: try:
pass enabled = config.is_enabled()
except AttributeError:
pass
else:
enabled = False
sys.path.remove(path) sys.path.remove(path)
sys.modules.pop("config") sys.modules.pop("config")
opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled)) opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled))
methods.write_modules(modules_detected) methods.write_modules(modules_detected)