Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Commit a5002e7

Browse files
committedMar 5, 2024·
Fix lib release
1 parent 0793608 commit a5002e7

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed
 

‎build.zig

+9-6
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,13 @@ pub fn build(b: *std.Build) void {
4141
.version = version,
4242
.root_source_file = .{ .path = "src/lib.zig" },
4343
});
44+
_ = lib.getEmittedH(); // Needed to trigger header generation
4445
lib.bundle_compiler_rt = true;
4546
lib.pie = true;
4647
const lib_install = b.addInstallArtifact(lib, .{});
47-
4848
// Ideally we would use dlib.getEmittedH(), but https://github.com/ziglang/zig/issues/18497
49-
_ = lib.getEmittedH(); // Needed to trigger header generation
5049
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);
5551

5652
// Dynamic Library
5753
const dylib = b.addSharedLibrary(.{
@@ -61,8 +57,15 @@ pub fn build(b: *std.Build) void {
6157
.version = version,
6258
.root_source_file = .{ .path = "src/lib.zig" },
6359
});
60+
_ = lib.getEmittedH(); // Needed to trigger header generation
6461
dylib.bundle_compiler_rt = true;
6562
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);
6669

6770
const dylib_step = b.step("dylib", "Build dynamic C library");
6871
dylib_step.dependOn(&lib_header.step);

0 commit comments

Comments
 (0)
This repository has been archived.