emoon/Rute

Potentially run rute_gen at part of build.rs in rute

Opened this issue · 0 comments

emoon commented

The idea would be to run rute_gen at the start of build.rs instead of having it separate as today. Benefits would be it would be possible to adjust the code-generation somewhat depending on the version of Qt that is installed on the machine.

It would also be possible to add version[...] flags to functions/values in the def files to say when something should only be generated for which version of Qt.

The generator is currently quite fast and doesn't take many sec to run as it's fully parallel.

This would also reduce the size of the of the crate as lots of the size comes from the auto-generated code.

Another benefit would be that the code-generator could only generate the Rust code and skip the C++ generation (this may be the case for plugins which will want to supply the main rust instance down to the plugins to not depend on the C++/Qt code directly)

Another good thing would be to allow the user to simply disable generation of widgets/code that isn't used. Not sure if anyone would do that though but it would perhaps reduce code size/link time a bit.

Drawback is of course that you need to run the generation at all but given the above benefits this might be worth it