Skip to content

Commit 5050db2

Browse files
committed
Include version.hpp in defs.hpp`` instead
1 parent e16ef69 commit 5050db2

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

binding_generator.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,6 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl
699699
result.append("#include <godot_cpp/core/defs.hpp>")
700700
result.append("")
701701

702-
# Fixes the "use of undeclared identifier 'set_typed'" compile error when typed_dictionary.hpp & dictionary.hpp are both included
703-
if class_name == "Dictionary":
704-
result.append("#include <godot_cpp/core/version.hpp>")
705-
result.append("")
706-
707702
# Special cases.
708703
if class_name == "String":
709704
result.append("#include <godot_cpp/classes/global_constants.hpp>")

include/godot_cpp/core/defs.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
#include <type_traits>
3636
#include <utility>
3737

38+
// version.hpp is generated, and won't exist in a clean checkout until the first build or after a cleanup.
39+
// __has_include (available since C++17) prevents errors in the IDE when it hasn't been created yet.
40+
#if __has_include(<godot_cpp/core/version.hpp>)
41+
#include <godot_cpp/core/version.hpp>
42+
#endif
43+
3844
namespace godot {
3945

4046
#if !defined(GDE_EXPORT)

0 commit comments

Comments
 (0)