@@ -41,17 +41,13 @@ pub fn build(b: *std.Build) void {
41
41
.version = version ,
42
42
.root_source_file = .{ .path = "src/lib.zig" },
43
43
});
44
+ _ = lib .getEmittedH (); // Needed to trigger header generation
44
45
lib .bundle_compiler_rt = true ;
45
46
lib .pie = true ;
46
47
const lib_install = b .addInstallArtifact (lib , .{});
47
-
48
48
// Ideally we would use dlib.getEmittedH(), but https://github.com/ziglang/zig/issues/18497
49
- _ = lib .getEmittedH (); // Needed to trigger header generation
50
49
const lib_header = b .addInstallFile (.{ .path = "zig-cache/fastlanez.h" }, "include/fastlanez.h" );
51
-
52
- const lib_step = b .step ("lib" , "Build static C library" );
53
- lib_step .dependOn (& lib_header .step );
54
- lib_step .dependOn (& lib_install .step );
50
+ lib_header .step .dependOn (& lib .step );
55
51
56
52
// Dynamic Library
57
53
const dylib = b .addSharedLibrary (.{
@@ -61,8 +57,15 @@ pub fn build(b: *std.Build) void {
61
57
.version = version ,
62
58
.root_source_file = .{ .path = "src/lib.zig" },
63
59
});
60
+ _ = lib .getEmittedH (); // Needed to trigger header generation
64
61
dylib .bundle_compiler_rt = true ;
65
62
const dylib_install = b .addInstallArtifact (dylib , .{});
63
+ const dylib_header = b .addInstallFile (.{ .path = "zig-cache/fastlanez.h" }, "include/fastlanez.h" );
64
+ dylib_header .step .dependOn (& dylib .step );
65
+
66
+ const lib_step = b .step ("lib" , "Build static C library" );
67
+ lib_step .dependOn (& lib_header .step );
68
+ lib_step .dependOn (& lib_install .step );
66
69
67
70
const dylib_step = b .step ("dylib" , "Build dynamic C library" );
68
71
dylib_step .dependOn (& lib_header .step );
0 commit comments