diff --git a/build.zig b/build.zig index 75f25d1..d997247 100644 --- a/build.zig +++ b/build.zig @@ -66,9 +66,13 @@ fn compileTheRightLua(b: *std.Build, c: *std.Build.Step.Compile, version: LuaVer fn addRunArtifact(b: *std.Build, os: std.Target.Os.Tag, exe: *std.Build.Step.Compile) *std.Build.Step.Run { if (os == .windows) { // do this so that windows can find dll's - return b.addSystemCommand(&[_][]const u8{ - b.getInstallPath(.bin, exe.name), - }); + const installed = b.addInstallArtifact(exe, .{}); + + // run the installed executable by path + const exe_path = b.getInstallPath(.bin, exe.name); + const run_cmd = b.addSystemCommand(&[_][]const u8{exe_path}); + run_cmd.step.dependOn(&installed.step); + return run_cmd; } else { return b.addRunArtifact(exe); }