Skip to content

Commit 8a3fcb9

Browse files
committed
update and run output_header_mapping.json
1 parent 6dc467a commit 8a3fcb9

File tree

4 files changed

+25627
-15
lines changed

4 files changed

+25627
-15
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,6 @@ jobs:
110110
with:
111111
python-version: '3.x'
112112

113-
- name: Clone Godot
114-
uses: actions/checkout@v4
115-
with:
116-
repository: godotengine/godot
117-
path: godot
118-
#ref: TODO take tag
119-
120-
- name: Generate compat mappings for godot
121-
run: |
122-
python compat_generator.py godot
123-
124113
- name: Android dependencies
125114
if: ${{ matrix.platform == 'android' }}
126115
uses: nttld/setup-ndk@v1

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,17 @@ first-party `godot-cpp` extension.
6868

6969
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.
7070

71-
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.
71+
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.
7272

73-
Example of how to obtain them:
73+
Example of how to run `compat_generator.py`:
7474

7575
```
7676
git clone godotengine/godot
7777
python compat_generator.py godot
7878
```
7979

80+
The first argument of `compat_generator.py` is the folder where the godot repo is. If this folder is not given, the current directory is assumed to be the godot repo.
81+
8082
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.
8183

8284
## Contributing

compat_generator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python
2+
13
import re
24
import os
35
import json
@@ -25,8 +27,9 @@ def parse_header_file(file_path):
2527
define_matches = re.findall(define_pattern, content)
2628
types["defines"] += define_matches
2729

28-
if len(types["classes"]) == 0 and len(types["structs"]) == 0 and len(types["defines"]) == 0:
29-
print(f"{file_path} missing things")
30+
# Debug the case where no classes or structs are found
31+
#if len(types["classes"]) == 0 and len(types["structs"]) == 0 and len(types["defines"]) == 0:
32+
# print(f"{file_path} missing things")
3033
return types
3134

3235

0 commit comments

Comments
 (0)