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

buildfile function to get target name relative to configuration #2

Open
Klaim opened this issue May 31, 2023 · 1 comment
Open

buildfile function to get target name relative to configuration #2

Klaim opened this issue May 31, 2023 · 1 comment

Comments

@Klaim
Copy link
Collaborator

Klaim commented May 31, 2023

Godot GDExtensions should follow a naming convention ideally that depends on the configuration.
For GDExtension example from the GDExtension tutorial, the .gdextension file describing to the Godot Engine which binary file to load as a plugin at runtime is described this way:

[configuration]

entry_symbol = "example_library_init"

[libraries]

macos.debug = "res://bin/libgdexample.macos.template_debug.framework"
macos.release = "res://bin/libgdexample.macos.template_release.framework"
windows.debug.x86_32 = "res://bin/libgdexample.windows.template_debug.x86_32.dll"
windows.release.x86_32 = "res://bin/libgdexample.windows.template_release.x86_32.dll"
windows.debug.x86_64 = "res://bin/libgdexample.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "res://bin/libgdexample.windows.template_release.x86_64.dll"
linux.debug.x86_64 = "res://bin/libgdexample.linux.template_debug.x86_64.so"
linux.release.x86_64 = "res://bin/libgdexample.linux.template_release.x86_64.so"
linux.debug.arm64 = "res://bin/libgdexample.linux.template_debug.arm64.so"
linux.release.arm64 = "res://bin/libgdexample.linux.template_release.arm64.so"
linux.debug.rv64 = "res://bin/libgdexample.linux.template_debug.rv64.so"
linux.release.rv64 = "res://bin/libgdexample.linux.template_release.rv64.so"
android.debug.x86_64 = "res://bin/libgdexample.android.template_debug.x86_64.so"
android.release.x86_64 = "res://bin/libgdexample.android.template_release.x86_64.so"
android.debug.arm64 = "res://bin/libgdexample.android.template_debug.arm64.so"
android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so"

While the binary could be just named libgdexample.so/dll/framework (I know that works because I tested it) and just copy pasted in the appropriate places, it would be helfpul to users to just provide a buildfile function that generate the right name for the library depending on which configuration it is built. Also that would allow to do one b install per configuration in the same directory would result in different binaries available, which is helpful for setting up a releaseable version of the game using Godot.

Providing such naming function is possible by implementing a build2-module (in C++).

@Klaim
Copy link
Collaborator Author

Klaim commented Sep 15, 2023

This might be done by providing an importable buildfile containing a special target-type, like gdextension{name}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant