@@ -17,10 +17,11 @@ pub fn build(b: *std.Build) void {
17
17
// set a preferred release mode, allowing the user to decide how to optimize.
18
18
const optimize = b .standardOptimizeOption (.{});
19
19
20
- const libzmq = b .dependency ("libzmq" , .{
20
+ const libzmq_dep = b .dependency ("libzmq" , .{
21
21
.optimize = optimize ,
22
22
.target = target ,
23
23
});
24
+ const libzmq = libzmq_dep .artifact ("zmq" );
24
25
const config_header = if (! target .isWindows ()) b .addConfigHeader (.{
25
26
.style = .blank ,
26
27
.include_path = "platform.h" ,
@@ -55,13 +56,14 @@ pub fn build(b: *std.Build) void {
55
56
lib .linkSystemLibraryName ("rpcrt4" );
56
57
lib .linkSystemLibraryName ("iphlpapi" );
57
58
}
58
- lib .linkLibrary (libzmq .artifact ("zmq" ));
59
- //lib.linkSystemLibrary("zmq");
59
+ lib .linkLibrary (libzmq );
60
60
lib .linkLibC ();
61
61
// This declares intent for the library to be installed into the standard
62
62
// location when the user invokes the "install" step (the default step when
63
63
// running `zig build`).
64
64
lib .install ();
65
+ lib .installHeadersDirectory ("../../include" , "" );
66
+ lib .installLibraryHeaders (libzmq );
65
67
66
68
// Creates a step for unit testing.
67
69
const libtest = b .addTest (.{
@@ -78,9 +80,8 @@ pub fn build(b: *std.Build) void {
78
80
libtest .linkSystemLibraryName ("rpcrt4" );
79
81
libtest .linkSystemLibraryName ("iphlpapi" );
80
82
}
81
- libtest .linkSystemLibrary ( "zmq" );
83
+ libtest .linkLibrary ( libzmq );
82
84
libtest .linkLibC ();
83
-
84
85
// This creates a build step. It will be visible in the `zig build --help` menu,
85
86
// and can be selected like this: `zig build test`
86
87
// This will evaluate the `test` step rather than the default, which is "install".
@@ -91,8 +92,7 @@ pub fn build(b: *std.Build) void {
91
92
const lib_flags : []const []const u8 = &.{
92
93
"-std=gnu99" ,
93
94
"-O3" ,
94
- // "-Wall",
95
- "-fno-sanitize=all" , // disable undefined sanitizer (default on zig/clang wrapper)
95
+ "-Wall" ,
96
96
};
97
97
const lib_src : []const []const u8 = &.{
98
98
"../../src/zactor.c" ,
0 commit comments