Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative paths for the .gdextension file such that the extension can be placed in any folder. #73

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

Ivorforce
Copy link
Contributor

@Ivorforce Ivorforce commented Feb 2, 2025

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 in addons/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

@Ivorforce Ivorforce force-pushed the relative-gdextension branch from 198a610 to 43dda28 Compare February 2, 2025 14:06
@dsnopek
Copy link
Contributor

dsnopek commented Feb 4, 2025

Discussed at the GDExtension meeting, and we think this makes sense because different people have different opinions about where GDExtensions should live in a project, and this allows them to freely move it.

@Ivorforce Ivorforce force-pushed the relative-gdextension branch from 43dda28 to dede668 Compare February 4, 2025 22:04
@paddy-exe paddy-exe added the enhancement New feature or request label Feb 5, 2025
@paddy-exe paddy-exe merged commit ba780e0 into godotengine:main Feb 5, 2025
23 checks passed
@paddy-exe
Copy link
Collaborator

Thanks!

@Ivorforce Ivorforce deleted the relative-gdextension branch February 5, 2025 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants