Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Avoid including modules/modules_enabled.gen.h in headers #100023

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions editor/editor_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -4576,8 +4575,6 @@ EditorHelpHighlighter::~EditorHelpHighlighter() {
#endif
}

#endif // defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED)

/// FindBar ///

FindBar::FindBar() {
Expand Down
4 changes: 0 additions & 4 deletions editor/editor_help.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -360,7 +358,6 @@ class EditorHelpBitTooltip : public PopupPanel {
EditorHelpBitTooltip(Control *p_target);
};

#if defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED)
class EditorSyntaxHighlighter;

class EditorHelpHighlighter {
Expand Down Expand Up @@ -395,4 +392,3 @@ class EditorHelpHighlighter {
EditorHelpHighlighter();
virtual ~EditorHelpHighlighter();
};
#endif // defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions modules/gdscript/tests/test_lsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -506,4 +510,6 @@ func f():

} // namespace GDScriptTests

#endif // MODULE_JSONRPC_ENABLED

#endif // TOOLS_ENABLED
21 changes: 17 additions & 4 deletions modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -5912,8 +5921,10 @@ void GLTFDocument::_convert_scene_node(Ref<GLTFState> p_state, Node *p_current,
}
}

#ifdef MODULE_CSG_ENABLED
void GLTFDocument::_convert_csg_shape_to_gltf(CSGShape3D *p_current, GLTFNodeIndex p_gltf_parent, Ref<GLTFNode> p_gltf_node, Ref<GLTFState> 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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -5996,8 +6007,10 @@ void GLTFDocument::_convert_light_to_gltf(Light3D *light, Ref<GLTFState> 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<GLTFNode> p_gltf_node, Ref<GLTFState> 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);
Expand Down Expand Up @@ -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,
Expand Down
13 changes: 2 additions & 11 deletions modules/gltf/gltf_document.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -339,20 +334,16 @@ class GLTFDocument : public Resource {
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<GLTFNode> p_gltf_node, Ref<GLTFState> p_state);
#endif // MODULE_CSG_ENABLED

void _check_visibility(Node *p_node, bool &r_retflag);
void _convert_camera_to_gltf(Camera3D *p_camera, Ref<GLTFState> p_state,
Ref<GLTFNode> 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<GLTFNode> p_gltf_node, Ref<GLTFState> p_state);
#endif // MODULE_GRIDMAP_ENABLED
void _convert_multi_mesh_instance_to_gltf(
MultiMeshInstance3D *p_multi_mesh_instance,
GLTFNodeIndex p_parent_node_index,
Expand Down
4 changes: 2 additions & 2 deletions modules/text_server_adv/thorvg_svg_in_ot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -55,8 +57,6 @@ using namespace godot;
#ifdef MODULE_SVG_ENABLED
#ifdef MODULE_FREETYPE_ENABLED

#include "thorvg_svg_in_ot.h"

#include <freetype/otsvg.h>
#include <ft2build.h>

Expand Down
4 changes: 2 additions & 2 deletions modules/text_server_fb/thorvg_svg_in_ot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -55,8 +57,6 @@ using namespace godot;
#ifdef MODULE_SVG_ENABLED
#ifdef MODULE_FREETYPE_ENABLED

#include "thorvg_svg_in_ot.h"

#include <freetype/otsvg.h>
#include <ft2build.h>

Expand Down