Skip to content

Commit

Permalink
Added disable_scripting option
Browse files Browse the repository at this point in the history
  • Loading branch information
Faolan-Rad committed Mar 8, 2024
1 parent 9b94c80 commit 5aebfb7
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 20 deletions.
9 changes: 9 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False))
opts.Add("vsproj_name", "Name of the Visual Studio solution", "godot")
opts.Add("import_env_vars", "A comma-separated list of environment variables to copy from the outer environment.", "")
opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False))
opts.Add(
BoolVariable("disable_scripting", "Disable scripting for a smaller executable for GDExtension projects", False)
)
opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False))
opts.Add("build_profile", "Path to a file containing a feature build profile", "")
opts.Add(BoolVariable("modules_enabled_by_default", "If no, disable all modules except ones explicitly enabled", True))
Expand Down Expand Up @@ -389,6 +392,9 @@ for name, path in modules_detected.items():
else:
enabled = False

if env_base["disable_scripting"] and name == "gdscript":
enabled = False

opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled))

# Add module-specific options.
Expand Down Expand Up @@ -905,6 +911,9 @@ if selected_platform in platform_list:
env["OBJPREFIX"] = env["object_prefix"]
env["SHOBJPREFIX"] = env["object_prefix"]

if env["disable_scripting"]:
env.Append(CPPDEFINES=["DISABLE_SCRIPTING"])

if env["disable_3d"]:
if env.editor_build:
print("Build option 'disable_3d=yes' cannot be used for editor builds, only for export template builds.")
Expand Down
Loading

0 comments on commit 5aebfb7

Please sign in to comment.