authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-30 18:11:07-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-30 18:12:00-07:00
log9d1816111d1d30e18b8cb43a4aa31c194fb204c4
tree573ce3827a015f7a349f7e333fda0580d2e0ea6e
parentf7d0a32045858be4eaba4b85d00e1bf3edbff43a

build system: pass dyn lib artifacts as positionals


2 files changed, 4 insertions(+), 7 deletions(-)

lib/std/build.zig+3-6
...@@ -1980,13 +1980,10 @@ pub const LibExeObjStep = struct {...@@ -1980,13 +1980,10 @@ pub const LibExeObjStep = struct {
1980 try zig_args.append(other.getOutputPath());1980 try zig_args.append(other.getOutputPath());
1981 },1981 },
1982 .Lib => {1982 .Lib => {
1983 if (!other.is_dynamic or self.target.isWindows()) {1983 const full_path_lib = other.getOutputPath();
1984 try zig_args.append(other.getOutputLibPath());1984 try zig_args.append(full_path_lib);
1985 } else {
1986 const full_path_lib = other.getOutputPath();
1987 try zig_args.append("--library");
1988 try zig_args.append(full_path_lib);
19891985
1986 if (other.is_dynamic and !self.target.isWindows()) {
1990 if (fs.path.dirname(full_path_lib)) |dirname| {1987 if (fs.path.dirname(full_path_lib)) |dirname| {
1991 try zig_args.append("-rpath");1988 try zig_args.append("-rpath");
1992 try zig_args.append(dirname);1989 try zig_args.append(dirname);
src/main.zig+1-1
...@@ -1402,7 +1402,7 @@ fn buildOutputType(...@@ -1402,7 +1402,7 @@ fn buildOutputType(
1402 continue;1402 continue;
1403 }1403 }
1404 if (std.fs.path.isAbsolute(lib_name)) {1404 if (std.fs.path.isAbsolute(lib_name)) {
1405 fatal("cannot use absolute path as a system library: {}", .{lib_name});1405 fatal("cannot use absolute path as a system library: {s}", .{lib_name});
1406 }1406 }
1407 i += 1;1407 i += 1;
1408 }1408 }