godot-nim / gdext-nim

Godot GDExtension binding for Nim
MIT License
27 stars 2 forks source link

Improve extension configure #60

Closed panno8M closed 1 week ago

panno8M commented 1 week ago

The configurations required for the build and the utilities for the configurations are collectively defined in buildconf.nim. This means that what file needs to configure will be only one config.nims, and that local projects do not need to be updated when new configurations are required due to library updates.

With the utilities defined by this PR, config.nims will look like this:

# config.nims
import gdext/buildconf

--path: src

Extension.name = "MyExtension"
Extension.version = (4, 3)
Extension.libdir = "$projectdir/lib"

This update also serves an important function in the automatic generation of .gdextension files in the future.

panno8M commented 1 week ago

Thank you for taking the time to help me out. I had heard some feedback from you about the configs and wanted to ask what you thought.

The whole point of this change is that the required configuration is defined in gdext package. the advantage of bootstrapconf.nims was that it separated the configuration required by the library from the user's custom configuration. This time, in addition, the settings required by the library will be hidden within the library. This will minimize the need to manually update the project's config.nims when new settings are required due to library updates.

By one config.nims, I did not mean to combine multiple extensions' config.nims into one, but to delete bootstrapconf.nims.

The motivation for expecting config.nims for each extension is simply that each extension has its own individual configuration needs. Such as the name of the extension and, depending on future updates, settings related to the generation of the .gdextension.