feat: update to Zig v0.13.0
This commit is contained in:
18
build.zig
18
build.zig
@@ -15,21 +15,21 @@ pub fn build(b: *std.Build) void {
|
||||
// set a preferred release mode, allowing the user to decide how to optimize.
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
_ = b.addModule("gdbstub", .{ .root_source_file = .{ .path = "src/lib.zig" } });
|
||||
_ = b.addModule("zba-gdbstub", .{ .root_source_file = b.path("src/lib.zig") });
|
||||
|
||||
// Creates a step for unit testing. This only builds the test executable
|
||||
// but does not run it.
|
||||
const tests = b.addTest(.{
|
||||
.root_source_file = .{ .path = "src/lib.zig" },
|
||||
const lib_unit_tests = b.addTest(.{
|
||||
.root_source_file = b.path("src/lib.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
const run_tests = b.addRunArtifact(tests);
|
||||
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
||||
|
||||
// This creates a build step. It will be visible in the `zig build --help` menu,
|
||||
// and can be selected like this: `zig build test`
|
||||
// This will evaluate the `test` step rather than the default, which is "install".
|
||||
const test_step = b.step("test", "Run library tests");
|
||||
test_step.dependOn(&run_tests.step);
|
||||
// Similar to creating the run step earlier, this exposes a `test` step to
|
||||
// the `zig build --help` menu, providing a way for the user to request
|
||||
// running the unit tests.
|
||||
const test_step = b.step("test", "Run unit tests");
|
||||
test_step.dependOn(&run_lib_unit_tests.step);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user