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

Refactor SConstruct, and add scu_build option. #69

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ivorforce
Copy link
Contributor

@Ivorforce Ivorforce commented Nov 17, 2024

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, while gdextension.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 the gdextension env now do not affect godot-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.

…oncerned with the build target. Add single compilation unit tool and option (scu_build).
@Ivorforce Ivorforce marked this pull request as draft November 26, 2024 18:44
@Ivorforce
Copy link
Contributor Author

Ivorforce commented Nov 26, 2024

Making this a draft while I figure out current issues with the build, while striving to keep godot-cpp-template simple.

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

Successfully merging this pull request may close these issues.

1 participant