htzx/build.zig

43 lines
1.1 KiB
Zig
Raw Normal View History

2023-10-26 18:54:59 -06:00
const std = @import("std");
2023-11-10 16:26:37 -07:00
const htzx = @import("build/htzx_build.zig");
2023-10-26 18:54:59 -06:00
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "zx",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
2023-11-02 14:22:20 -06:00
// Creates a step for unit testing. This only builds the test executable
2023-10-26 18:54:59 -06:00
// but does not run it.
const main_tests = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
const run_main_tests = b.addRunArtifact(main_tests);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&run_main_tests.step);
2023-11-10 16:26:37 -07:00
try htzx.build_htzx(b, exe);
2023-10-26 18:54:59 -06:00
}