commit d4c56804dfd3f53de1f0950fac9478b096a2a0b4 (tree)
parent 7fe2a3d104319835127456d02ba73efc5fe5f207
Author: Luuk de Gram <luuk@degram.dev>
Date: Sun, 21 Aug 2022 16:42:11 +0200
std: fix EmulatableRunStep
Fixes a compilation error when using the `EmulatableRunStep`
that is being generated from a step directly using `runEmulatable`.
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/std/build.zig b/lib/std/build.zig
@@ -1898,7 +1898,11 @@ pub const LibExeObjStep = struct {
pub fn runEmulatable(exe: *LibExeObjStep) *EmulatableRunStep {
assert(exe.kind == .exe or exe.kind == .test_exe);
- return EmulatableRunStep.create(exe.builder, exe.builder.fmt("run {s}", .{exe.step.name}), exe);
+ const run_step = EmulatableRunStep.create(exe.builder, exe.builder.fmt("run {s}", .{exe.step.name}), exe);
+ if (exe.vcpkg_bin_path) |path| {
+ RunStep.addPathDirInternal(&run_step.step, exe.builder, path);
+ }
+ return run_step;
}
pub fn checkObject(self: *LibExeObjStep, obj_format: std.Target.ObjectFormat) *CheckObjectStep {
diff --git a/lib/std/build/RunStep.zig b/lib/std/build/RunStep.zig
@@ -101,7 +101,7 @@ pub fn addPathDir(self: *RunStep, search_path: []const u8) void {
}
/// For internal use only, users of `RunStep` should use `addPathDir` directly.
-fn addPathDirInternal(step: *Step, builder: *Builder, search_path: []const u8) void {
+pub fn addPathDirInternal(step: *Step, builder: *Builder, search_path: []const u8) void {
const env_map = getEnvMapInternal(step, builder.allocator);
const key = "PATH";