diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index ca16f84da94..3a42405f625 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -4410,7 +4410,6 @@ EditorHelpBitTooltip::EditorHelpBitTooltip(Control *p_target) { set_process_internal(true); } -#if defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED) /// EditorHelpHighlighter /// EditorHelpHighlighter *EditorHelpHighlighter::singleton = nullptr; @@ -4576,8 +4575,6 @@ EditorHelpHighlighter::~EditorHelpHighlighter() { #endif } -#endif // defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED) - /// FindBar /// FindBar::FindBar() { diff --git a/editor/editor_help.h b/editor/editor_help.h index 04c3f80e294..5f68388087b 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -40,8 +40,6 @@ #include "scene/gui/text_edit.h" #include "scene/main/timer.h" -#include "modules/modules_enabled.gen.h" // For gdscript, mono. - class FindBar : public HBoxContainer { GDCLASS(FindBar, HBoxContainer); @@ -360,7 +358,6 @@ public: EditorHelpBitTooltip(Control *p_target); }; -#if defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED) class EditorSyntaxHighlighter; class EditorHelpHighlighter { @@ -395,4 +392,3 @@ public: EditorHelpHighlighter(); virtual ~EditorHelpHighlighter(); }; -#endif // defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED) diff --git a/modules/gdscript/language_server/gdscript_language_protocol.h b/modules/gdscript/language_server/gdscript_language_protocol.h index 6b9479bce5d..afdd849b8d9 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.h +++ b/modules/gdscript/language_server/gdscript_language_protocol.h @@ -36,12 +36,7 @@ #include "core/io/stream_peer_tcp.h" #include "core/io/tcp_server.h" -#include "modules/modules_enabled.gen.h" // For jsonrpc. -#ifdef MODULE_JSONRPC_ENABLED #include "modules/jsonrpc/jsonrpc.h" -#else -#error "Can't build GDScript LSP without JSONRPC module." -#endif #define LSP_MAX_BUFFER_SIZE 4194304 #define LSP_MAX_CLIENTS 8 diff --git a/modules/gdscript/tests/test_lsp.h b/modules/gdscript/tests/test_lsp.h index f55343f5c50..976aa2b5099 100644 --- a/modules/gdscript/tests/test_lsp.h +++ b/modules/gdscript/tests/test_lsp.h @@ -32,6 +32,10 @@ #ifdef TOOLS_ENABLED +#include "modules/modules_enabled.gen.h" // For jsonrpc. + +#ifdef MODULE_JSONRPC_ENABLED + #include "tests/test_macros.h" #include "../language_server/gdscript_extend_parser.h" @@ -506,4 +510,6 @@ func f(): } // namespace GDScriptTests +#endif // MODULE_JSONRPC_ENABLED + #endif // TOOLS_ENABLED diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 2fb95dd2d82..1585daf70dc 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -62,6 +62,15 @@ #include "editor/editor_file_system.h" #endif +#include "modules/modules_enabled.gen.h" // For csg, gridmap. + +#ifdef MODULE_CSG_ENABLED +#include "modules/csg/csg_shape.h" +#endif +#ifdef MODULE_GRIDMAP_ENABLED +#include "modules/gridmap/grid_map.h" +#endif + // FIXME: Hardcoded to avoid editor dependency. #define GLTF_IMPORT_GENERATE_TANGENT_ARRAYS 8 #define GLTF_IMPORT_USE_NAMED_SKIN_BINDS 16 @@ -5912,8 +5921,10 @@ void GLTFDocument::_convert_scene_node(Ref p_state, Node *p_current, } } -#ifdef MODULE_CSG_ENABLED void GLTFDocument::_convert_csg_shape_to_gltf(CSGShape3D *p_current, GLTFNodeIndex p_gltf_parent, Ref p_gltf_node, Ref p_state) { +#ifndef MODULE_CSG_ENABLED + ERR_FAIL_MSG("csg module is disabled."); +#else CSGShape3D *csg = p_current; csg->call("_update_shape"); Array meshes = csg->get_meshes(); @@ -5964,8 +5975,8 @@ void GLTFDocument::_convert_csg_shape_to_gltf(CSGShape3D *p_current, GLTFNodeInd p_gltf_node->transform = csg->get_transform(); p_gltf_node->set_original_name(csg->get_name()); p_gltf_node->set_name(_gen_unique_name(p_state, csg->get_name())); -} #endif // MODULE_CSG_ENABLED +} void GLTFDocument::_check_visibility(Node *p_node, bool &r_retflag) { r_retflag = true; @@ -5996,8 +6007,10 @@ void GLTFDocument::_convert_light_to_gltf(Light3D *light, Ref p_state } } -#ifdef MODULE_GRIDMAP_ENABLED void GLTFDocument::_convert_grid_map_to_gltf(GridMap *p_grid_map, GLTFNodeIndex p_parent_node_index, GLTFNodeIndex p_root_node_index, Ref p_gltf_node, Ref p_state) { +#ifndef MODULE_GRIDMAP_ENABLED + ERR_FAIL_MSG("gridmap module is disabled."); +#else Array cells = p_grid_map->get_used_cells(); for (int32_t k = 0; k < cells.size(); k++) { GLTFNode *new_gltf_node = memnew(GLTFNode); @@ -6025,8 +6038,8 @@ void GLTFDocument::_convert_grid_map_to_gltf(GridMap *p_grid_map, GLTFNodeIndex new_gltf_node->set_original_name(p_grid_map->get_mesh_library()->get_item_name(cell)); new_gltf_node->set_name(_gen_unique_name(p_state, p_grid_map->get_mesh_library()->get_item_name(cell))); } -} #endif // MODULE_GRIDMAP_ENABLED +} void GLTFDocument::_convert_multi_mesh_instance_to_gltf( MultiMeshInstance3D *p_multi_mesh_instance, diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h index f847a6fa00f..38e668606d8 100644 --- a/modules/gltf/gltf_document.h +++ b/modules/gltf/gltf_document.h @@ -38,13 +38,8 @@ #include "scene/3d/mesh_instance_3d.h" #include "scene/3d/multimesh_instance_3d.h" -#include "modules/modules_enabled.gen.h" // For csg, gridmap. -#ifdef MODULE_CSG_ENABLED -#include "modules/csg/csg_shape.h" -#endif // MODULE_CSG_ENABLED -#ifdef MODULE_GRIDMAP_ENABLED -#include "modules/gridmap/grid_map.h" -#endif // MODULE_GRIDMAP_ENABLED +class CSGShape3D; +class GridMap; class GLTFDocument : public Resource { GDCLASS(GLTFDocument, Resource); @@ -339,20 +334,16 @@ public: const GLTFNodeIndex p_gltf_current, const GLTFNodeIndex p_gltf_root); -#ifdef MODULE_CSG_ENABLED void _convert_csg_shape_to_gltf(CSGShape3D *p_current, GLTFNodeIndex p_gltf_parent, Ref p_gltf_node, Ref p_state); -#endif // MODULE_CSG_ENABLED void _check_visibility(Node *p_node, bool &r_retflag); void _convert_camera_to_gltf(Camera3D *p_camera, Ref p_state, Ref p_gltf_node); -#ifdef MODULE_GRIDMAP_ENABLED void _convert_grid_map_to_gltf( GridMap *p_grid_map, GLTFNodeIndex p_parent_node_index, GLTFNodeIndex p_root_node_index, Ref p_gltf_node, Ref p_state); -#endif // MODULE_GRIDMAP_ENABLED void _convert_multi_mesh_instance_to_gltf( MultiMeshInstance3D *p_multi_mesh_instance, GLTFNodeIndex p_parent_node_index, diff --git a/modules/text_server_adv/thorvg_svg_in_ot.cpp b/modules/text_server_adv/thorvg_svg_in_ot.cpp index 62aadf1b0bb..e88cb682015 100644 --- a/modules/text_server_adv/thorvg_svg_in_ot.cpp +++ b/modules/text_server_adv/thorvg_svg_in_ot.cpp @@ -28,6 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#include "thorvg_svg_in_ot.h" + #ifdef GDEXTENSION // Headers for building as GDExtension plug-in. @@ -55,8 +57,6 @@ using namespace godot; #ifdef MODULE_SVG_ENABLED #ifdef MODULE_FREETYPE_ENABLED -#include "thorvg_svg_in_ot.h" - #include #include diff --git a/modules/text_server_fb/thorvg_svg_in_ot.cpp b/modules/text_server_fb/thorvg_svg_in_ot.cpp index 62aadf1b0bb..e88cb682015 100644 --- a/modules/text_server_fb/thorvg_svg_in_ot.cpp +++ b/modules/text_server_fb/thorvg_svg_in_ot.cpp @@ -28,6 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#include "thorvg_svg_in_ot.h" + #ifdef GDEXTENSION // Headers for building as GDExtension plug-in. @@ -55,8 +57,6 @@ using namespace godot; #ifdef MODULE_SVG_ENABLED #ifdef MODULE_FREETYPE_ENABLED -#include "thorvg_svg_in_ot.h" - #include #include