Description
This issue is to remove the @cImport
language builtin, instead relying on the feature being provided by the build system (std.Build.Step.TranslateC
).
This removes one dependency on libclang inside the Zig compiler executable, which is required for #16270. In the near-term future, the translate-c implementation will still be inside the Zig compiler executable, along with the ability to compile C/C++ source files. However, we can prepare users for this transition by solving the use case via the build system rather than a language feature.
As a consolation prize, the TranslateC build step can be enhanced with advanced settings, such as namespace stripping and validation of existing bindings. Since changes to this don't require changing the language, it's OK if the scope & complexity increase to some extent.
Blockers:
- translate-c build step causing crash in build system #20648
- move https://ziglang.org/learn/build-system/ to become a guide along with the language reference
- translate-c build step lacks a way to link system libraries #20649
Related: