asmaloney / GDExtensionTemplate

📜 A template project for building Godot 4 GDExtensions using CMake
The Unlicense
228 stars 22 forks source link

Differences between the release and debug builds #68

Open RafaDdS opened 6 months ago

RafaDdS commented 6 months ago

Hey, great project! But I have had problems running it.

Using: Ubuntu 22.04 Godot 4.1 and 4.2

Info after the first part of the build:

Using CMake 3.29.0 -- Building GDExtensionTemplate for x86_64 on Linux -- [GDExtensionTemplate] Treating warnings as errors -- Using git: /usr/bin/git (git version 2.25.1) -- GDExtensionTemplate version: 30d51b4 -- Install directory: /path on my computer/GDExtensionTemplate-install/GDExtensionTemplate/ -- Using ccache: /usr/bin/ccache (ccache version 3.7.7) -- Configuring done (0.5s) -- Generating done (0.2s) -- Build files have been written to: /path on my computer/GDExtensionTemplate-build

After coping the template and following the setup and build steps I tried to open the template extension on Godot 4.1, since it's the master of the godot-cpp submodule and it fails to load.

I also tried to specify the 4.2 module on the .gitmodule and run it on Godot 4.2. In this case I ran an update on the submodule with (git submodule update --remote) It builds without any error, but when I install it in the bin folder of a new empty godot project I get the following error:

core/extension/gdextension.cpp:911 - No GDExtension library found for current OS and architecture (linux.x86_64) in configuration file: res://bin/GDExtensionTemplate/GDExtensionTemplate.gdextension Failed loading resource: res://bin/GDExtensionTemplate/GDExtensionTemplate.gdextension. Make sure resources have been imported by opening the project in the editor at least once.

The .so file is in the right place according to the .gdextension. It also specify paths for windows and mac builds that are not being generated for the time.

I did make some small changes since the compiler is treating warnings as errors, mostly just removed semicolons the compiler judged not necessary.

Anyone has similar problems? I have been looking for a solution for the last two weeks.

RafaDdS commented 6 months ago

Found the problem, the default build will only push the release path for the library. It would be nice if the process to build for debug was better documented.

If anyone has the same problem go to the .GDExtension in the templates.release duplicate the path lines and substitute the .release for .debug

There is probably a better solution to keep release and debug builds separated. If anyone could help pointing it out for anyone in the future it would be nice.