authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-14 11:33:27-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-14 11:33:27-07:00
log193c529b8c9529c4303aeb3a8864dfee9b1d2485
treecefad76a85ae260c2b49ce8a613a778de562cb30
parent5a4249fa25ab789a8c060e5ba71ca8b0358e9c8d

CLI: rename --override-lib-dir to --zig-lib-dir

This breaking change disambiguates between overriding the lib dir when performing an installation with the Zig Build System, and overriding the lib dir that the Zig installation itself uses.

10 files changed, 17 insertions(+), 17 deletions(-)

CMakeLists.txt+2-2
......@@ -782,7 +782,7 @@ set(BUILD_ZIG1_ARGS
782782 -target "${ZIG_TARGET_TRIPLE}"
783783 "-mcpu=${ZIG_TARGET_MCPU}"
784784 --name zig1
785 --override-lib-dir "${CMAKE_SOURCE_DIR}/lib"
785 --zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
786786 "-femit-bin=${ZIG1_OBJECT}"
787787 "${ZIG1_RELEASE_ARG}"
788788 "${ZIG1_SINGLE_THREADED_ARG}"
......@@ -836,7 +836,7 @@ set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
836836
837837if(NOT ZIG_SKIP_INSTALL_LIB_FILES)
838838 set(ZIG_INSTALL_ARGS "build"
839 --override-lib-dir "${CMAKE_SOURCE_DIR}/lib"
839 --zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
840840 "-Dlib-files-only"
841841 --prefix "${CMAKE_INSTALL_PREFIX}"
842842 "-Dconfig_h=${ZIG_CONFIG_H_OUT}"
ci/azure/linux_script+1-1
......@@ -79,7 +79,7 @@ if [ "${BUILD_REASON}" != "PullRequest" ]; then
7979 # Produce the experimental std lib documentation.
8080 mkdir -p release/docs/std
8181 release/bin/zig test ../lib/std/std.zig \
82 --override-lib-dir ../lib \
82 --zig-lib-dir ../lib \
8383 -femit-docs=release/docs/std \
8484 -fno-emit-bin
8585
ci/azure/macos_arm64_script+1-1
......@@ -94,7 +94,7 @@ if [ "${BUILD_REASON}" != "PullRequest" ]; then
9494 # Produce the experimental std lib documentation.
9595 mkdir -p release/docs/std
9696 $ZIG test ../lib/std/std.zig \
97 --override-lib-dir ../lib \
97 --zig-lib-dir ../lib \
9898 -femit-docs=release/docs/std \
9999 -fno-emit-bin
100100
lib/std/build.zig+2-2
......@@ -2716,10 +2716,10 @@ pub const LibExeObjStep = struct {
27162716 }
27172717
27182718 if (self.override_lib_dir) |dir| {
2719 try zig_args.append("--override-lib-dir");
2719 try zig_args.append("--zig-lib-dir");
27202720 try zig_args.append(builder.pathFromRoot(dir));
27212721 } else if (self.builder.override_lib_dir) |dir| {
2722 try zig_args.append("--override-lib-dir");
2722 try zig_args.append("--zig-lib-dir");
27232723 try zig_args.append(builder.pathFromRoot(dir));
27242724 }
27252725
lib/std/crypto/benchmark.zig+1-1
......@@ -3,7 +3,7 @@
33// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
44// The MIT license requires this copyright notice to be included in all copies
55// and substantial portions of the software.
6// zig run benchmark.zig --release-fast --override-lib-dir ..
6// zig run benchmark.zig --release-fast --zig-lib-dir ..
77
88const std = @import("../std.zig");
99const builtin = std.builtin;
lib/std/hash/benchmark.zig+1-1
......@@ -3,7 +3,7 @@
33// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
44// The MIT license requires this copyright notice to be included in all copies
55// and substantial portions of the software.
6// zig run benchmark.zig --release-fast --override-lib-dir ..
6// zig run benchmark.zig --release-fast --zig-lib-dir ..
77
88const builtin = std.builtin;
99const std = @import("std");
lib/std/os.zig+1-1
......@@ -41,7 +41,7 @@ pub const wasi = @import("os/wasi.zig");
4141pub const windows = @import("os/windows.zig");
4242
4343comptime {
44 assert(@import("std") == std); // std lib tests require --override-lib-dir
44 assert(@import("std") == std); // std lib tests require --zig-lib-dir
4545}
4646
4747test {
lib/std/special/build_runner.zig+3-3
......@@ -119,9 +119,9 @@ pub fn main() !void {
119119 warn("expected [auto|on|off] after --color, found '{s}'", .{next_arg});
120120 return usageAndErr(builder, false, stderr_stream);
121121 };
122 } else if (mem.eql(u8, arg, "--override-lib-dir")) {
122 } else if (mem.eql(u8, arg, "--zig-lib-dir")) {
123123 builder.override_lib_dir = nextArg(args, &arg_idx) orelse {
124 warn("Expected argument after --override-lib-dir\n\n", .{});
124 warn("Expected argument after --zig-lib-dir\n\n", .{});
125125 return usageAndErr(builder, false, stderr_stream);
126126 };
127127 } else if (mem.eql(u8, arg, "--verbose-tokenize")) {
......@@ -234,7 +234,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void
234234 \\Advanced Options:
235235 \\ --build-file [file] Override path to build.zig
236236 \\ --cache-dir [path] Override path to zig cache directory
237 \\ --override-lib-dir [arg] Override path to Zig lib directory
237 \\ --zig-lib-dir [arg] Override path to Zig lib directory
238238 \\ --verbose-tokenize Enable compiler debug output for tokenization
239239 \\ --verbose-ast Enable compiler debug output for parsing into an AST
240240 \\ --verbose-link Enable compiler debug output for linking
src/main.zig+3-3
......@@ -310,7 +310,7 @@ const usage_build_generic =
310310 \\ --show-builtin Output the source of @import("builtin") then exit
311311 \\ --cache-dir [path] Override the local cache directory
312312 \\ --global-cache-dir [path] Override the global cache directory
313 \\ --override-lib-dir [path] Override path to Zig installation lib directory
313 \\ --zig-lib-dir [path] Override path to Zig installation lib directory
314314 \\ --enable-cache Output to cache directory; print path to stdout
315315 \\
316316 \\Compile Options:
......@@ -888,7 +888,7 @@ fn buildOutputType(
888888 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});
889889 i += 1;
890890 override_global_cache_dir = args[i];
891 } else if (mem.eql(u8, arg, "--override-lib-dir")) {
891 } else if (mem.eql(u8, arg, "--zig-lib-dir")) {
892892 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});
893893 i += 1;
894894 override_lib_dir = args[i];
......@@ -2664,7 +2664,7 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v
26642664 i += 1;
26652665 build_file = args[i];
26662666 continue;
2667 } else if (mem.eql(u8, arg, "--override-lib-dir")) {
2667 } else if (mem.eql(u8, arg, "--zig-lib-dir")) {
26682668 if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg});
26692669 i += 1;
26702670 override_lib_dir = args[i];
src/stage1/zig0.cpp+2-2
......@@ -351,7 +351,7 @@ int main(int argc, char **argv) {
351351 out_name = argv[i];
352352 } else if (strcmp(arg, "--dynamic-linker") == 0) {
353353 dynamic_linker = argv[i];
354 } else if (strcmp(arg, "--override-lib-dir") == 0) {
354 } else if (strcmp(arg, "--zig-lib-dir") == 0) {
355355 override_lib_dir = argv[i];
356356 } else if (strcmp(arg, "--library") == 0 || strcmp(arg, "-l") == 0) {
357357 if (strcmp(argv[i], "c") == 0) {
......@@ -433,7 +433,7 @@ int main(int argc, char **argv) {
433433 }
434434
435435 if (override_lib_dir == nullptr) {
436 fprintf(stderr, "missing --override-lib-dir\n");
436 fprintf(stderr, "missing --zig-lib-dir\n");
437437 return print_error_usage(arg0);
438438 }
439439