-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
c project depends on pure c module failed to build #18493
Comments
Looks like your .zon file in the dependency is missing the include directory https://github.com/binarycraft007/add/blob/main/build.zig.zon:
Is that intentional? |
No it's not, fixed it, thanks for pointing it out, but that's not the problem why the error is reported though |
judging from the cli, the build system assumed that pure c module without root_source_file is a zig dependency, that's not true, by removing |
Note that the bug here is that the build system creates an invalid command line to give to the compiler. Your project tree, as it currently exists, is not intended to work without any changes. After my patch in #18622, this is the (correct) result:
The build system already provides a way to expose a static library with headers. You can find plenty of examples of this already. Zig modules in the build system are not a way to expose C headers to other compilations. The use case for providing Zig API bindings for a C library looks like this:
Then you can expose that zig module. That already worked before, and is not impacted by #18622 at all. |
Thanks for the explanation, I think this is due to my misunderstanding of the new build system design, it's great to finally have the clarification. |
Zig Version
0.12.0-dev.2076+8fd15c6ca
Steps to Reproduce and Observed Behavior
Expected Behavior
Building should succeed.
The text was updated successfully, but these errors were encountered: