Refactor SConstruct, and add scu_build option. #69
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.
The refactor aims to to separate library-specific options from those concerned with the build target. In this design,
SConstruct
exists to provide an 'unopinionated' framework between godot-cpp and the gdextension, which most gdextensions will share, whilegdextension.py
can be freely modified to fit the project.I don't think the new structure is perfect yet, but I do prefer it to the structure we have currently, where SConstruct is kind of difficult to avoid messing up. The new structure roughly mimics the structure of the godot-cpp SConstruct, where most of the actual information is in
godotcpp.py
.Add single compilation unit tool and option (scu_build). This option mimics godot's own scu_build option: It compiles the whole project as a single cpp file. This can improve binary size and speed, if supported by the project.
Finally, there is a change to how
localEnv
is handled: Any options or modifications applied to thegdextension
env now do not affectgodot-cpp
(unless specified explicitly). For example, in my own project I compile with-DXTENSOR_USE_XSIMD
. This used to be passed to all godot-cpp files too, which is of course nonsense. By cloning the godot-cpp env, you can modify the new env flags without affecting godot-cpp compilation. Loosely, this mimics how SCSubs are handled in godot upstream.