@cImport is moving to the build system in an upcoming version (0.17, I think?). It's inconvenient, but it's unfortunately necessary.
The issue with @cImport is that when and the order the imports occur are almost impossible to define if you have multiple files and libraries. By moving it to the build system, the order now becomes deterministic and you can refer to it properly.
7 comments
[ 2.9 ms ] story [ 36.3 ms ] threadIt’s also decoupling Zig compiler and C compiler so they’re updated independently.
It’s still a bummer in my view as I just replaced my build pipelines with just a Zig compiler instead of emscripten but that’s fine.
@cImport is moving to the build system in an upcoming version (0.17, I think?). It's inconvenient, but it's unfortunately necessary.
The issue with @cImport is that when and the order the imports occur are almost impossible to define if you have multiple files and libraries. By moving it to the build system, the order now becomes deterministic and you can refer to it properly.
The build system allows you to expose C libraries as Zig modules that can be imported with the normal @import builtin.
https://flipper.net/products/flipper-zero