Fix compilation for zig 0.14.0-dev.1457+7e3180487
Compilation succeeds with the command:
zig build -fsys=sdl2 sdl-standalone
Only SDL2 backend tested.
Fixes #118.
Without passing -fsys=sdl2 I get error: HeaderConfigFailed and a bunch of
error: /home/<>/.cache/zig/p/<hash>/include/SDL_config.h.cmake:35: unable to substitute variable: error: MissingValue
errors which stops compilation. Probably due to another change in 0.14; looking into it.
These changes are going to break compiling on zig 0.13 right? I assume the renaming of the @typeInfo is not backwards compatible.
dvui tracks the latest stable zig release, so I'll keep this open until zig 0.14 is released and then we'll update.
Thank you!
Yep this will definitely be breaking. I've converted the PR to a draft for now -- sorry I missed the part where you track the latest stable! I'll keep updating my branch on the side so hopefully it's not much effort to upgrade to zig 0.14 when it is released :)
Is struct a strong keyword in Zig 0.14.0-dev.1457+7e3180487? i.e. Do you need to @"struct" quote it?
Is
structa strong keyword in Zig 0.14.0-dev.1457+7e3180487? i.e. Do you need to@"struct"quote it?
Just checked, definitely needs @""
Upstream dependencies for raylib and SDL will need to update their build.zigs to 0.14 before this PR can build.
Regarding the field name changes (which is the bulk of this PR), there is an alternative solution which may be worth looking into: https://ziggit.dev/t/require-specific-zig-version-in-build-script/7135/6
Interesting! I'm expecting zig 0.14 to land in early 2025 (January I hope), but will pursue that strategy if needed. Thanks!
@raddari Thanks for this - I based https://github.com/david-vanderson/dvui/pull/173 on it, which has now been merged, so I think this PR can be closed too. I just realized my rebase accidentally removed your authorship info from your commit though - I'm sorry about that, no ill will intended! EDIT: I guess that could still be fixed with a force-push - your and @david-vanderson 's call.
No ill taken at all, cheers for carrying it forward! Don’t worry about the authorship. I’m just happy to see dvui compile for 0.14 :)
Thank you!