diff --git a/SConstruct b/SConstruct index 92bcb1d059a..cc2b8684ffe 100644 --- a/SConstruct +++ b/SConstruct @@ -125,7 +125,6 @@ opts.Add(BoolVariable("use_lto", "Use link-time optimization", False)) # Components opts.Add(BoolVariable("deprecated", "Enable deprecated features", True)) -opts.Add(BoolVariable("gdscript", "Enable GDScript support", True)) opts.Add(BoolVariable("minizip", "Enable ZIP archive support using minizip", True)) opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver", False)) opts.Add("custom_modules", "A list of comma-separated directory paths containing custom modules to build.", "") @@ -575,8 +574,6 @@ if selected_platform in platform_list: sys.exit(255) else: env.Append(CPPDEFINES=["_3D_DISABLED"]) - if env["gdscript"]: - env.Append(CPPDEFINES=["GDSCRIPT_ENABLED"]) if env["disable_advanced_gui"]: if env["tools"]: print( diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index f1474d87923..e37aadafa93 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -36,7 +36,8 @@ #include "editor_scale.h" #include "editor_settings.h" -#ifdef SVG_ENABLED +#include "modules/modules_enabled.gen.h" +#ifdef MODULE_SVG_ENABLED #include "modules/svg/image_loader_svg.h" #endif @@ -104,7 +105,7 @@ static Ref flip_icon(Ref p_texture, bool p_flip_y = false, boo return texture; } -#ifdef SVG_ENABLED +#ifdef MODULE_SVG_ENABLED static Ref editor_generate_icon(int p_index, bool p_convert_color, float p_scale = EDSCALE, bool p_force_filter = false) { Ref icon = memnew(ImageTexture); Ref img = memnew(Image); @@ -133,7 +134,7 @@ static Ref editor_generate_icon(int p_index, bool p_convert_color, #endif void editor_register_and_generate_icons(Ref p_theme, bool p_dark_theme = true, int p_thumb_size = 32, bool p_only_thumbs = false) { -#ifdef SVG_ENABLED +#ifdef MODULE_SVG_ENABLED // The default icon theme is designed to be used for a dark theme. // This dictionary stores color codes to convert to other colors // for better readability on a light theme. @@ -1383,7 +1384,7 @@ Ref create_custom_theme(const Ref p_theme) { } Ref create_unscaled_default_project_icon() { -#ifdef SVG_ENABLED +#ifdef MODULE_SVG_ENABLED for (int i = 0; i < editor_icons_count; i++) { // ESCALE should never affect size of the icon if (strcmp(editor_icons_names[i], "DefaultProjectIcon") == 0) { diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 5699a5a84f4..98be6aa5925 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -37,7 +37,8 @@ #include "editor/project_settings_editor.h" #include "scene/gui/grid_container.h" -#ifdef GDSCRIPT_ENABLED +#include "modules/modules_enabled.gen.h" +#ifdef MODULE_GDSCRIPT_ENABLED #include "modules/gdscript/gdscript.h" #endif @@ -78,7 +79,9 @@ void PluginConfigDialog::_on_confirmed() { // TODO Use script templates. Right now, this code won't add the 'tool' annotation to other languages. // TODO Better support script languages with named classes (has_named_classes). -#ifdef GDSCRIPT_ENABLED + // FIXME: It's hacky to have hardcoded access to the GDScript module here. + // The editor code should not have to know what languages are enabled. +#ifdef MODULE_GDSCRIPT_ENABLED if (lang_name == GDScriptLanguage::get_singleton()->get_name()) { // Hard-coded GDScript template to keep usability until we use script templates. Ref