summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-06 21:51:36 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-02-07 11:50:40 +0100
commitf3726ee99488695c4aae22fffd3649499b285faf (patch)
tree72c94797816a2f3da5ad4cb59a177ec74674a357 /modules
parentb7297fb39ca7a55390f9390666bd29803adc827f (diff)
Use modules_enabled.gen.h to improve inter dependency checks
- Fix build with gdscript module disabled. Fixes #31011. - Remove unused `gdscript` compile option. - Fix build with regex module disabled. - Fix ImageLoaderSVG to forward declare thirdparty structs.
Diffstat (limited to 'modules')
-rw-r--r--modules/freetype/SCsub2
-rw-r--r--modules/recast/navigation_mesh_generator.cpp3
-rw-r--r--modules/svg/SCsub4
-rw-r--r--modules/svg/image_loader_svg.cpp5
-rw-r--r--modules/svg/image_loader_svg.h7
5 files changed, 8 insertions, 13 deletions
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
index 8f4a8de895..7b66aa1c76 100644
--- a/modules/freetype/SCsub
+++ b/modules/freetype/SCsub
@@ -102,5 +102,3 @@ if env['builtin_freetype']:
# Godot source files
env_freetype.add_source_files(env.modules_sources, "*.cpp")
-# Used in scene/, needs to be in main env
-env.Append(CPPDEFINES=['FREETYPE_ENABLED'])
diff --git a/modules/recast/navigation_mesh_generator.cpp b/modules/recast/navigation_mesh_generator.cpp
index c67136b814..b6f5b38038 100644
--- a/modules/recast/navigation_mesh_generator.cpp
+++ b/modules/recast/navigation_mesh_generator.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "navigation_mesh_generator.h"
+
#include "core/math/quick_hull.h"
#include "core/os/thread.h"
#include "editor/editor_settings.h"
@@ -45,10 +46,10 @@
#include "scene/resources/shape.h"
#include "scene/resources/sphere_shape.h"
+#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CSG_ENABLED
#include "modules/csg/csg_shape.h"
#endif
-
#ifdef MODULE_GRIDMAP_ENABLED
#include "modules/gridmap/grid_map.h"
#endif
diff --git a/modules/svg/SCsub b/modules/svg/SCsub
index 9324c1634b..7961d1f33e 100644
--- a/modules/svg/SCsub
+++ b/modules/svg/SCsub
@@ -13,10 +13,6 @@ thirdparty_sources = [
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_svg.Prepend(CPPPATH=[thirdparty_dir])
-# FIXME: Needed in editor/editor_themes.cpp for now, but ideally there
-# shouldn't be a dependency on modules/ and its own 3rd party deps.
-env.Prepend(CPPPATH=[thirdparty_dir])
-env.Append(CPPDEFINES=["SVG_ENABLED"])
env_thirdparty = env_svg.Clone()
env_thirdparty.disable_warnings()
diff --git a/modules/svg/image_loader_svg.cpp b/modules/svg/image_loader_svg.cpp
index 11ae2f81bf..7f91908a33 100644
--- a/modules/svg/image_loader_svg.cpp
+++ b/modules/svg/image_loader_svg.cpp
@@ -30,9 +30,8 @@
#include "image_loader_svg.h"
-#include "core/os/os.h"
-#include "core/print_string.h"
-#include "core/ustring.h"
+#include <nanosvg.h>
+#include <nanosvgrast.h>
void SVGRasterizer::rasterize(NSVGimage *p_image, float p_tx, float p_ty, float p_scale, unsigned char *p_dst, int p_w, int p_h, int p_stride) {
nsvgRasterize(rasterizer, p_image, p_tx, p_ty, p_scale, p_dst, p_w, p_h, p_stride);
diff --git a/modules/svg/image_loader_svg.h b/modules/svg/image_loader_svg.h
index 9e9366e91b..24cee82480 100644
--- a/modules/svg/image_loader_svg.h
+++ b/modules/svg/image_loader_svg.h
@@ -34,13 +34,14 @@
#include "core/io/image_loader.h"
#include "core/ustring.h"
-#include <nanosvg.h>
-#include <nanosvgrast.h>
-
/**
@author Daniel Ramirez <djrmuv@gmail.com>
*/
+// Forward declare and include thirdparty headers in .cpp.
+struct NSVGrasterizer;
+struct NSVGimage;
+
class SVGRasterizer {
NSVGrasterizer *rasterizer;