@@ -17,10 +17,11 @@ pub fn build(b: *std.Build) void {
1717 // set a preferred release mode, allowing the user to decide how to optimize.
1818 const optimize = b .standardOptimizeOption (.{});
1919
20- const libzmq = b .dependency ("libzmq" , .{
20+ const libzmq_dep = b .dependency ("libzmq" , .{
2121 .optimize = optimize ,
2222 .target = target ,
2323 });
24+ const libzmq = libzmq_dep .artifact ("zmq" );
2425 const config_header = if (! target .isWindows ()) b .addConfigHeader (.{
2526 .style = .blank ,
2627 .include_path = "platform.h" ,
@@ -55,13 +56,14 @@ pub fn build(b: *std.Build) void {
5556 lib .linkSystemLibraryName ("rpcrt4" );
5657 lib .linkSystemLibraryName ("iphlpapi" );
5758 }
58- lib .linkLibrary (libzmq .artifact ("zmq" ));
59- //lib.linkSystemLibrary("zmq");
59+ lib .linkLibrary (libzmq );
6060 lib .linkLibC ();
6161 // This declares intent for the library to be installed into the standard
6262 // location when the user invokes the "install" step (the default step when
6363 // running `zig build`).
6464 lib .install ();
65+ lib .installHeadersDirectory ("../../include" , "" );
66+ lib .installLibraryHeaders (libzmq );
6567
6668 // Creates a step for unit testing.
6769 const libtest = b .addTest (.{
@@ -78,9 +80,8 @@ pub fn build(b: *std.Build) void {
7880 libtest .linkSystemLibraryName ("rpcrt4" );
7981 libtest .linkSystemLibraryName ("iphlpapi" );
8082 }
81- libtest .linkSystemLibrary ( "zmq" );
83+ libtest .linkLibrary ( libzmq );
8284 libtest .linkLibC ();
83-
8485 // This creates a build step. It will be visible in the `zig build --help` menu,
8586 // and can be selected like this: `zig build test`
8687 // This will evaluate the `test` step rather than the default, which is "install".
@@ -91,8 +92,7 @@ pub fn build(b: *std.Build) void {
9192const lib_flags : []const []const u8 = &.{
9293 "-std=gnu99" ,
9394 "-O3" ,
94- // "-Wall",
95- "-fno-sanitize=all" , // disable undefined sanitizer (default on zig/clang wrapper)
95+ "-Wall" ,
9696};
9797const lib_src : []const []const u8 = &.{
9898 "../../src/zactor.c" ,
0 commit comments