Skip to content

Commit 0fee272

Browse files
committed
Merge pull request godotengine#100751 from YYF233333/force_regex_with_editor
Force build editor with regex module, remove checking code
2 parents 9788b3d + 34d8255 commit 0fee272

33 files changed

+52
-168
lines changed

SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ methods.sort_module_list(env)
961961

962962
if env.editor_build:
963963
# Add editor-specific dependencies to the dependency graph.
964-
env.module_add_dependencies("editor", ["freetype", "svg"])
964+
env.module_add_dependencies("editor", ["freetype", "regex", "svg"])
965965

966966
# And check if they are met.
967967
if not env.module_check_dependencies("editor"):

core/io/logger.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
#include "core/os/time.h"
3636

3737
#include "modules/modules_enabled.gen.h" // For regex.
38+
#ifdef MODULE_REGEX_ENABLED
39+
#include "modules/regex/regex.h"
40+
#else
41+
class RegEx : public RefCounted {};
42+
#endif // MODULE_REGEX_ENABLED
3843

3944
#if defined(MINGW_ENABLED) || defined(_MSC_VER)
4045
#define sprintf sprintf_s

core/io/logger.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@
3434
#include "core/io/file_access.h"
3535
#include "core/string/ustring.h"
3636
#include "core/templates/vector.h"
37-
#include "modules/modules_enabled.gen.h" // For regex.
38-
#ifdef MODULE_REGEX_ENABLED
39-
#include "modules/regex/regex.h"
40-
#endif // MODULE_REGEX_ENABLED
4137

4238
#include <stdarg.h>
4339

40+
class RegEx;
41+
4442
class Logger {
4543
protected:
4644
bool should_log(bool p_err);
@@ -90,9 +88,7 @@ class RotatedFileLogger : public Logger {
9088
void clear_old_backups();
9189
void rotate_file();
9290

93-
#ifdef MODULE_REGEX_ENABLED
9491
Ref<RegEx> strip_ansi_regex;
95-
#endif // MODULE_REGEX_ENABLED
9692

9793
public:
9894
explicit RotatedFileLogger(const String &p_base_path, int p_max_files = 10);

editor/editor_node.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@
164164
#include "editor/themes/editor_theme_manager.h"
165165
#include "editor/window_wrapper.h"
166166

167-
#include <stdlib.h>
168-
169167
#include "modules/modules_enabled.gen.h" // For gdscript, mono.
170168

169+
#include <stdlib.h>
170+
171171
EditorNode *EditorNode::singleton = nullptr;
172172

173173
static const String EDITOR_NODE_CONFIG_SECTION = "EditorNode";

editor/export/codesign.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,15 @@
3232

3333
#include "core/crypto/crypto_core.h"
3434
#include "core/io/dir_access.h"
35-
#include "lipo.h"
36-
#include "macho.h"
37-
3835
#include "core/io/plist.h"
3936
#include "editor/editor_paths.h"
37+
#include "lipo.h"
38+
#include "macho.h"
4039

41-
#include "modules/modules_enabled.gen.h" // For regex.
40+
#include "modules/regex/regex.h"
4241

4342
#include <ctime>
4443

45-
#ifdef MODULE_REGEX_ENABLED
46-
47-
#include "modules/regex/regex.h"
48-
4944
/*************************************************************************/
5045
/* CodeSignCodeResources */
5146
/*************************************************************************/
@@ -1571,5 +1566,3 @@ Error CodeSign::codesign(bool p_use_hardened_runtime, bool p_force, const String
15711566
ERR_FAIL_V_MSG(FAILED, "CodeSign: Unknown object type.");
15721567
}
15731568
}
1574-
1575-
#endif // MODULE_REGEX_ENABLED

editor/export/codesign.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@
4444
#include "core/io/file_access.h"
4545
#include "core/object/ref_counted.h"
4646

47-
#include "modules/modules_enabled.gen.h" // For regex.
48-
49-
#ifdef MODULE_REGEX_ENABLED
50-
5147
/*************************************************************************/
5248
/* CodeSignCodeResources */
5349
/*************************************************************************/
@@ -356,6 +352,4 @@ class CodeSign {
356352
static Error codesign(bool p_use_hardened_runtime, bool p_force, const String &p_path, const String &p_ent_path, String &r_error_msg);
357353
};
358354

359-
#endif // MODULE_REGEX_ENABLED
360-
361355
#endif // CODESIGN_H

editor/import/resource_importer_dynamic_font.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
#include "scene/resources/font.h"
3737
#include "servers/text_server.h"
3838

39-
#include "modules/modules_enabled.gen.h" // For freetype.
40-
4139
String ResourceImporterDynamicFont::get_importer_name() const {
4240
return "font_data_dynamic";
4341
}
@@ -48,7 +46,6 @@ String ResourceImporterDynamicFont::get_visible_name() const {
4846

4947
void ResourceImporterDynamicFont::get_recognized_extensions(List<String> *p_extensions) const {
5048
if (p_extensions) {
51-
#ifdef MODULE_FREETYPE_ENABLED
5249
p_extensions->push_back("ttf");
5350
p_extensions->push_back("ttc");
5451
p_extensions->push_back("otf");
@@ -57,7 +54,6 @@ void ResourceImporterDynamicFont::get_recognized_extensions(List<String> *p_exte
5754
p_extensions->push_back("woff2");
5855
p_extensions->push_back("pfb");
5956
p_extensions->push_back("pfm");
60-
#endif
6157
}
6258
}
6359

editor/plugins/bone_map_editor_plugin.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#include "scene/gui/separator.h"
4242
#include "scene/gui/texture_rect.h"
4343

44+
#include "modules/regex/regex.h"
45+
4446
void BoneMapperButton::fetch_textures() {
4547
if (selected) {
4648
set_texture_normal(get_editor_theme_icon(SNAME("BoneMapperHandleSelected")));
@@ -531,7 +533,6 @@ void BoneMapper::_clear_mapping_current_group() {
531533
}
532534
}
533535

534-
#ifdef MODULE_REGEX_ENABLED
535536
bool BoneMapper::is_match_with_bone_name(const String &p_bone_name, const String &p_word) {
536537
RegEx re = RegEx(p_word);
537538
return re.search(p_bone_name.to_lower()).is_valid();
@@ -1352,7 +1353,6 @@ void BoneMapper::auto_mapping_process(Ref<BoneMap> &p_bone_map) {
13521353

13531354
WARN_PRINT("Finish auto mapping.");
13541355
}
1355-
#endif // MODULE_REGEX_ENABLED
13561356

13571357
void BoneMapper::_value_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
13581358
set(p_property, p_value);
@@ -1367,9 +1367,7 @@ void BoneMapper::_profile_changed(const String &p_property, const Variant &p_val
13671367
if (profile.is_valid()) {
13681368
SkeletonProfileHumanoid *hmn = Object::cast_to<SkeletonProfileHumanoid>(profile.ptr());
13691369
if (hmn) {
1370-
#ifdef MODULE_REGEX_ENABLED
13711370
_run_auto_mapping();
1372-
#endif // MODULE_REGEX_ENABLED
13731371
}
13741372
}
13751373
}

editor/plugins/bone_map_editor_plugin.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
#include "editor/editor_properties.h"
3636
#include "editor/plugins/editor_plugin.h"
3737

38-
#include "modules/modules_enabled.gen.h" // For regex.
39-
#ifdef MODULE_REGEX_ENABLED
40-
#include "modules/regex/regex.h"
41-
#endif
42-
4338
#include "scene/3d/skeleton_3d.h"
4439
#include "scene/gui/box_container.h"
4540
#include "scene/gui/color_rect.h"
@@ -170,7 +165,6 @@ class BoneMapper : public VBoxContainer {
170165
void _apply_picker_selection();
171166
void _clear_mapping_current_group();
172167

173-
#ifdef MODULE_REGEX_ENABLED
174168
/* For auto mapping */
175169
enum BoneSegregation {
176170
BONE_SEGREGATION_NONE,
@@ -182,7 +176,6 @@ class BoneMapper : public VBoxContainer {
182176
BoneSegregation guess_bone_segregation(const String &p_bone_name);
183177
void auto_mapping_process(Ref<BoneMap> &p_bone_map);
184178
void _run_auto_mapping();
185-
#endif // MODULE_REGEX_ENABLED
186179

187180
protected:
188181
void _notification(int p_what);

editor/project_converter_3_to_4.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,14 @@
3232

3333
#ifndef DISABLE_DEPRECATED
3434

35-
#include "modules/modules_enabled.gen.h" // For regex.
36-
37-
#ifdef MODULE_REGEX_ENABLED
38-
3935
#include "core/error/error_macros.h"
4036
#include "core/io/dir_access.h"
4137
#include "core/io/file_access.h"
4238
#include "core/object/ref_counted.h"
4339
#include "core/os/time.h"
4440
#include "core/templates/list.h"
4541
#include "editor/renames_map_3_to_4.h"
42+
4643
#include "modules/regex/regex.h"
4744

4845
// Find "OS.set_property(x)", capturing x into $1.
@@ -2957,6 +2954,4 @@ String ProjectConverter3To4::collect_string_from_vector(Vector<SourceLine> &vect
29572954
return string;
29582955
}
29592956

2960-
#endif // MODULE_REGEX_ENABLED
2961-
29622957
#endif // DISABLE_DEPRECATED

0 commit comments

Comments
 (0)