Skip to content

Commit ac5822f

Browse files
authored
Merge pull request #14 from McSinyx/install
Curate top-level install target
2 parents f442d44 + d02a4dd commit ac5822f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

build.zig

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ pub fn build(b: *std.Build) void {
1414
.target = target,
1515
.optimize = optimize,
1616
});
17-
1817
lib.bundle_compiler_rt = true;
1918
lib.addIncludePath(b.path("src"));
2019
lib.linkLibC();
21-
20+
lib.installHeader(b.path("src/ini.h"), "ini.h");
2221
b.installArtifact(lib);
2322

23+
const example_step = b.step("example", "Build examples");
2424
const example_c = b.addExecutable(.{
2525
.name = "example-c",
2626
.optimize = optimize,
@@ -37,8 +37,7 @@ pub fn build(b: *std.Build) void {
3737
example_c.addIncludePath(b.path("src"));
3838
example_c.linkLibrary(lib);
3939
example_c.linkLibC();
40-
41-
b.installArtifact(example_c);
40+
example_step.dependOn(&b.addInstallArtifact(example_c, .{}).step);
4241

4342
const example_zig = b.addExecutable(.{
4443
.name = "example-zig",
@@ -47,8 +46,7 @@ pub fn build(b: *std.Build) void {
4746
.target = target,
4847
});
4948
example_zig.root_module.addImport("ini", b.modules.get("ini").?);
50-
51-
b.installArtifact(example_zig);
49+
example_step.dependOn(&b.addInstallArtifact(example_zig, .{}).step);
5250

5351
const test_step = b.step("test", "Run library tests");
5452
const main_tests = b.addTest(.{

0 commit comments

Comments
 (0)