Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* makes '$build_root/{install,debug}/' the default prefix. This makes it not '$pwd/zig-cache/'.
  • Loading branch information
g-w1 committed Dec 31, 2020
1 parent 2622575 commit fea9487
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/std/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,14 @@ pub const Builder = struct {
self.install_path = fs.path.join(self.allocator, &[_][]const u8{ dest_dir, install_prefix }) catch unreachable;
} else {
const install_prefix = self.install_prefix orelse blk: {
const p = self.cache_root;
const p = if (self.release_mode) |mode| switch (mode) {
.Debug => "debug",
.ReleaseSafe => "release",
.ReleaseFast => "release",
.ReleaseSmall => "release",
} else "debug";
self.install_prefix = p;
break :blk p;
break :blk self.pathFromRoot(p);
};
self.install_path = install_prefix;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/std/special/build_runner.zig
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ pub fn main() !void {
}
}

builder.resolveInstallPrefix();
try runBuild(builder);
builder.resolveInstallPrefix();

if (builder.validateUserInputDidItFail())
return usageAndErr(builder, true, stderr_stream);
Expand Down

0 comments on commit fea9487

Please sign in to comment.