mirror of
https://github.com/allyourcodebase/nng.git
synced 2026-11-17 01:30:29 +00:00
nanomsg-next-generation (nng) packaged for the zig build system
- Zig 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* Remove Zig module that re-exports C symbols * Delete examples folder * Add build workflow * Fix lld not supported on mach-o files * Remove formatting step * Remove windows and mac workflows Will support those platforms later. * Update README |
||
| .github/workflows | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| LICENSE | ||
| README.md | ||
nng
nanomessage next generation packaged using the zig build system.
Currently it's only properly tested in linux. If you have a build bug in another platform feel free to open a issue (or better, a PR).
Usage
Add the dep to your build.zig.zon:
# master
zig fetch --save git+https://github.com/Tomcat-42/nng
# tagged release
zig fetch --save https://github.com/Tomcat-42/nng/archive/refs/tags/${tag}.tar.gz
Then in the build.zig file add the library as a dep:
const nng = b.dependency("nng", .{ .optimize = optimize, .target = target });
compile_target.linklibrary(nng.artifact("nng"));
Then, in your compile target:
const nng = @cImport({
@cInclude("nng/nng.h");
@cInclude("nng/args.h");
@cInclude("nng/http.h");
});