Skip to content

Commit 4901b0e

Browse files
committed
update docs
1 parent 4085cc2 commit 4901b0e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ and the [godot-cpp issue tracker](https://github.com/godotengine/godot-cpp/issue
6262
for a list of known issues, and be sure to provide feedback on issues and PRs
6363
which affect your use of this extension.
6464

65+
## Godot and Godot Cpp Compatibility
66+
67+
If you intend to target both building as a GDExtension and as a module using godot repo, you can generate compatibility includes that will target either GDExtension or module, based on the GODOT_MODULE_COMPAT define.
68+
69+
If you want such a thing built, when running the build command, `scons`, make sure you have a file called `output_header_mapping.json` at root level of this repo. This file needs to have the mappings from `godot` repo. The mappings can be generated by running the compat_generator.py script.
70+
71+
Example of how to obtain them:
72+
73+
```
74+
git clone godotengine/godot
75+
python compat_generator.py godot
76+
```
77+
78+
Then run the SConstruct build command as usual, and in the `gen/` folder you will now have a new folder, `include/godot_compat` which mirrors the `include/godot_cpp` includes, but have ifdef inside them and either include godot header or godot_cpp header.
79+
6580
## Contributing
6681

6782
We greatly appreciate help in maintaining and extending this project. If you

compat_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def parse_header_file(file_path):
99
types = {"classes": [], "structs": []}
1010
# print(file_path)
1111

12-
with open(file_path, "r") as file:
12+
with open(file_path, "r", encoding="utf-8") as file:
1313
content = file.read()
1414

1515
# Regular expressions to match different types

0 commit comments

Comments
 (0)