From f0af9b9955fb7286eee26b9e932826bc8a29ad35 Mon Sep 17 00:00:00 2001 From: Lorenzo Torres Date: Mon, 11 Aug 2025 13:14:55 +0200 Subject: [PATCH] Added run target to build.zig --- build.zig | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/build.zig b/build.zig index deb122f..7bc8960 100644 --- a/build.zig +++ b/build.zig @@ -85,6 +85,16 @@ pub fn build(b: *std.Build) void { exe.linkSystemLibrary("xcb-icccm"); } 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 Sideros"); + run_step.dependOn(&run_cmd.step); }, .macos => { const exe = b.addExecutable(.{ @@ -105,6 +115,16 @@ pub fn build(b: *std.Build) void { exe.root_module.linkFramework("QuartzCore", .{}); exe.linkLibrary(sideros); 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 Sideros"); + run_step.dependOn(&run_cmd.step); }, else => { std.debug.panic("Compilation not implemented for OS: {any}\n", .{target.result.os.tag}); @@ -119,15 +139,7 @@ pub fn build(b: *std.Build) void { const docs_step = b.step("docs", "Generate documentation"); docs_step.dependOn(&install_docs.step); - //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); + const exe_unit_tests = b.addTest(.{ .root_module = b.createModule(.{