Skip to content

Commit 5079d11

Browse files
committed
std/build: change default install prefix to zig-out
Currently the default install prefix is $BUILD_ROOT/zig-cache, but mixing cache and artifacts makes little sense. Instead make $BUILD_ROOT/zig-out the default.
1 parent 2ed368f commit 5079d11

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# -andrewrk
1111

1212
zig-cache/
13+
zig-out/
1314
/release/
1415
/debug/
1516
/build/

lib/std/build.zig

+2-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ pub const Builder = struct {
195195
self.install_prefix = install_prefix orelse "/usr";
196196
self.install_path = fs.path.join(self.allocator, &[_][]const u8{ dest_dir, self.install_prefix }) catch unreachable;
197197
} else {
198-
self.install_prefix = install_prefix orelse self.cache_root;
198+
self.install_prefix = install_prefix orelse
199+
(fs.path.join(self.allocator, &[_][]const u8{ self.build_root, "zig-out" }) catch unreachable);
199200
self.install_path = self.install_prefix;
200201
}
201202
self.lib_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "lib" }) catch unreachable;

0 commit comments

Comments
 (0)