| author | |
| committer | |
| log | 4e07755ce705066cdb4e20feebc5010c7e3e6d12 |
| tree | c1676ae89de0a886055c730a17c1336cd55f372b |
| parent | 585479500e1941da25bcc4c55a4c3abc69fec031 |
| parent | 5079d11b213a02e9d9465f3371d0833021cfc636 |
| signature | Signed by PGP key 4AEE18F83AFDEB23 |
std/build: change default install prefix to zig-out 3 files changed, 6 insertions(+), 4 deletions(-)
.gitignore+1| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | # -andrewrk |
| 11 | 11 | |
| 12 | 12 | zig-cache/ |
| 13 | zig-out/ | |
| 13 | 14 | /release/ |
| 14 | 15 | /debug/ |
| 15 | 16 | /build/ |
lib/std/build.zig+2-1| ... | ... | @@ -195,7 +195,8 @@ pub const Builder = struct { |
| 195 | 195 | self.install_prefix = install_prefix orelse "/usr"; |
| 196 | 196 | self.install_path = fs.path.join(self.allocator, &[_][]const u8{ dest_dir, self.install_prefix }) catch unreachable; |
| 197 | 197 | } 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); | |
| 199 | 200 | self.install_path = self.install_prefix; |
| 200 | 201 | } |
| 201 | 202 | self.lib_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "lib" }) catch unreachable; |
lib/std/special/build_runner.zig+3-3| ... | ... | @@ -82,9 +82,9 @@ pub fn main() !void { |
| 82 | 82 | builder.verbose = true; |
| 83 | 83 | } else if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { |
| 84 | 84 | return usage(builder, false, stdout_stream); |
| 85 | } else if (mem.eql(u8, arg, "--prefix")) { | |
| 85 | } else if (mem.eql(u8, arg, "-p") or mem.eql(u8, arg, "--prefix")) { | |
| 86 | 86 | install_prefix = nextArg(args, &arg_idx) orelse { |
| 87 | warn("Expected argument after --prefix\n\n", .{}); | |
| 87 | warn("Expected argument after {s}\n\n", .{arg}); | |
| 88 | 88 | return usageAndErr(builder, false, stderr_stream); |
| 89 | 89 | }; |
| 90 | 90 | } else if (mem.eql(u8, arg, "--search-prefix")) { |
| ... | ... | @@ -188,7 +188,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void |
| 188 | 188 | \\General Options: |
| 189 | 189 | \\ -h, --help Print this help and exit |
| 190 | 190 | \\ --verbose Print commands before executing them |
| 191 | \\ --prefix [path] Override default install prefix | |
| 191 | \\ -p, --prefix [path] Override default install prefix | |
| 192 | 192 | \\ --search-prefix [path] Add a path to look for binaries, libraries, headers |
| 193 | 193 | \\ --color [auto|off|on] Enable or disable colored error messages |
| 194 | 194 | \\ |