Use relative paths for the .gdextension
file such that the extension can be placed in any folder.
#73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If we use absolute paths (as is done now), the GDExtension will only correctly load if placed in
res://bin
, but if we use relative paths, it will correctly load from any location.I think using relative paths is more appropriate as it's less error prone if any user wants to modify the path from
bin/
to somewhere else. Commonly, for example, GDExtensions will be placed inaddons/extensionname
.This is technically not important for the demo project, as we don't expect the extension to be moved around there, but the modified
.gdextension
is the only one we currently have, and there's no real downside to the change.I opened this PR this after writing an answer to this proposal. I think the described issue may be common enough to warrant giving an example of how best to do it in the template.
I'm using
./
to start relative paths to avoid this unresolved issue: godotengine/godot-cpp#1681