Skip to content

Commit 511e02b

Browse files
committed
Auto-commit before backup
1 parent 3659398 commit 511e02b

File tree

7 files changed

+1250
-235
lines changed

7 files changed

+1250
-235
lines changed

build.zig

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
const std = @import("std");
22

33
pub fn build(b: *std.build.Builder) !void {
4-
const mode = b.standardReleaseOptions();
54
const target = b.standardTargetOptions(.{});
5+
const optimize = b.standardOptimizeOption(.{});
66

7-
const lib = b.addStaticLibrary("gintro", "src/lib.zig");
7+
const lib = b.addStaticLibrary(.{ .name = "gintro", .root_source_file = .{ .path = "src/lib.zig" }, .target = target, .optimize = optimize });
88
lib.linkLibC();
99
lib.linkSystemLibrary("gobject-introspection-1.0");
1010

11-
const exe = b.addExecutable("gintro", "src/gintro.zig");
12-
exe.setTarget(target);
11+
const exe = b.addExecutable(.{
12+
.name = "gintro",
13+
.root_source_file = .{ .path = "src/gintro.zig" },
14+
.target = target,
15+
.optimize = optimize,
16+
});
1317
exe.linkLibrary(lib);
14-
exe.setBuildMode(mode);
15-
exe.install();
18+
b.installArtifact(exe);
1619

17-
const run_cmd = exe.run();
20+
const run_cmd = b.addRunArtifact(exe);
1821
run_cmd.step.dependOn(b.getInstallStep());
1922
if (b.args) |args| {
2023
run_cmd.addArgs(args);
@@ -23,9 +26,11 @@ pub fn build(b: *std.build.Builder) !void {
2326
const run_step = b.step("run", "Run the app");
2427
run_step.dependOn(&run_cmd.step);
2528

26-
var main_tests = b.addTest("src/gintro.zig");
27-
main_tests.setBuildMode(mode);
29+
var main_tests = b.addTest(.{ .root_source_file = .{ .path = "src/test.zig" }, .optimize = optimize, .target = target });
30+
main_tests.linkLibrary(lib);
31+
32+
const run_test = b.addRunArtifact(main_tests);
2833

2934
const test_step = b.step("test", "Run library tests");
30-
test_step.dependOn(&main_tests.step);
35+
test_step.dependOn(&run_test.step);
3136
}

0 commit comments

Comments
 (0)