-
-
Notifications
You must be signed in to change notification settings - Fork 467
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(eventsub): generate entire files #5897
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small note, but this seems like a good approach
I don't like reading the extra cmake code but it is what it is
6aeda0e
to
d3e5fac
Compare
e8d5d9c
to
dae6da0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected on my machine, thank you!
After rebasing on top of master, the freebsd builds are very slow. It seems like this is because there's no freebsd wheels for |
I added an option to skip it entirely |
This refactors the generation of the JSON parsing to happen at build time and at whole file level. There are two advantages: (1) we can utilize modern processor capabilities and generate multiple files simultaneously (multithreading) and (2) we can make our build system happy, which only knows about whole files (and their timestamps).
One important goal is that building the deserializers is optional (i.e. if someone doesn't have libclang, or it can't parse a TU, the build should still work).
When configuring, we do the following:
generate_json_impls
, the corresponding source and include paths are computedadd_custom_command
)twitch-eventsub-ws
target (in both cases, however, if generation is supported, these files will have a dependency on the previously generated target)In CI, we generate on Ubuntu-24.04 and Windows (where
FORCE_JSON_GENERATION=On
). I'm not sure why this fails on macOS, even withllvm
installed (seems like it can't find Qt headers).