raulsntos / godot-dotnet

MIT License
86 stars 13 forks source link

Build fails when building with a custom header file generated from built-from-source Godot #19

Closed takethebait closed 2 months ago

takethebait commented 2 months ago

Godot version

4.4.dev (61598c5c88d95b96811d386cb20d714c35f4c6d7)

Godot .NET packages version

master (f497a903559d687b2d479aafd766c912cbe39cd6)

System information

Windows 11

.NET information

.NET SDK: Version: 8.0.400 Commit: 36fe6dda56 Workload version: 8.0.400-manifests.56cd0383 MSBuild version: 17.11.3+0c8610977

Issue description

I'm currently attempting to build the project for a custom Godot build. Building using the provided extension api JSON and C header works (apart from the warnings) but building it with JSON and C header generated from a custom godot build fails with the following error:

 ERROR: X:\godot-dotnet\gdextension\gdextension_interface.h:271:89: error: unknown type name 'bool'

I've build my Godot version using the following props in the custom.py:

production = "yes"
module_camera_enabled = "no"
module_mobile_vr_enabled = "no"
module_mono_enabled = "yes"
module_openxr_enabled = "no"
module_webrtc_enabled = "no"
module_websocket_enabled = "no"
module_webxr_enabled = "no"

Steps to reproduce

  1. Cloned the repository
  2. Executed ./build.cmd --productBuild --warnAsError false /p:GenerateGodotBindings=true without modifying any file. This step succeeded.
  3. Generated the required header files by running .\godot.windows.editor.x86_64.mono.console.exe --dump-extension-api --dump-gdextension-interface
  4. Copied and replaced the files .\gdextension\extension_api.json as well as .\gdextension\gdextension_interface.h with the files generated in step 3
  5. Attempted to re-run step 2 which resulted in the error message listed in the issue description.

Minimal reproduction project

The C header as well as the extension api json can be found here: extension_api.zip

raulsntos commented 2 months ago

Also, as a side-note, it looks like you may be using the mono version of the editor so be aware that it may not work well, there may be conflicts/compatibility issues. I recommend using the standard version.

takethebait commented 2 months ago

Yup, that was it! Updated the source, rebuilt Godot and now it looks good. Thanks!