Closed kassane closed 1 year ago
How would a zig developer use this to build a zig compatible library?
How would a zig developer use this to build a zig compatible library?
Hi, @jmcnamara
Using that build the developers could choose to create a binding on top of the original library or access the library directly.
In other words, do you remember the binding built by me? zig-xlsxwriter
Well, with this change, not only could that project benefit from the library addition be downloaded, build and run with the included binding (another project) or also, users can bypass my binding and use the library directly with @cImport/@cInclude
(zig translate-c
inside) to auto-generate a binding, regardless of the user-binding project that me or any other developers.
more info: https://ziglang.org/documentation/master/#cImport-vs-translate-c
Using zig toolchain does not exactly mean that need to create a ziglang project, could replace the makefile, cmake, or any other conventional tool with zig. zig toolchain is pure-LLVM buildtools (replaces: build-essential/base-devel - does not include dbgs or binutils).
In general I'd prefer not to add this type of configuration to the root directory. I made an exception for iOS and now there are too many Coacoa and other related files as well as several PRs.
I prefer the VPG and Homebrew approaches where the package updates are in an external repository, like this: https://vcpkg.roundtrip.dev/ports/libxlsxwriter
However, I like Zig as a language and would like to support it so if you agree to support the library additions and make any fixes that are required in the future then I will merge it.
OK! I will even complete support for zlib and minizip dependencies. (Optional install)
Ok. Merged. Thanks!
closes #401
How to use
build.zig
&build.zig.zon
filee.g:
More info about zig-pkg