~alva/scratchy

74628062c2e78f9071f4ed817a3f47814a55fc0e — owl 1 year, 2 months ago 66a1534 trunk
Fix build
1 files changed, 19 insertions(+), 10 deletions(-)

M build.zig
M build.zig => build.zig +19 -10
@@ 9,20 9,25 @@ pub fn build(b: *std.build.Builder) void {

    // Standard release options allow the person running `zig build` to select
    // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
    const mode = b.standardReleaseOptions();

    const exe = b.addExecutable("scratchy", "src/main.zig");
    exe.setTarget(target);
    exe.setBuildMode(mode);
    const optimize = b.standardOptimizeOption(.{});

    const exe = b.addExecutable(
        .{
            .name = "scratchy",
            .root_source_file = .{ .path = "src/main.zig" },
            .target = target,
            .optimize = optimize,
        },
    );
    exe.linkLibC();

    if (target.getOsTag() == .linux) {
        exe.linkSystemLibrary("pulse-simple");
    }

    exe.install();
    b.installArtifact(exe);

    const run_cmd = exe.run();
    const run_cmd = b.addRunArtifact(exe);
    run_cmd.step.dependOn(b.getInstallStep());
    if (b.args) |args| {
        run_cmd.addArgs(args);


@@ 31,9 36,13 @@ pub fn build(b: *std.build.Builder) void {
    const run_step = b.step("run", "Run the app");
    run_step.dependOn(&run_cmd.step);

    const exe_tests = b.addTest("src/main.zig");
    exe_tests.setTarget(target);
    exe_tests.setBuildMode(mode);
    const exe_tests = b.addTest(.{
        .root_source_file = .{
            .path = "src/main.zig",
        },
        .target = target,
        .optimize = optimize,
    });

    const test_step = b.step("test", "Run unit tests");
    test_step.dependOn(&exe_tests.step);