build system: pass dyn lib artifacts as positionals

This commit is contained in:
Andrew Kelley 2020-11-30 18:11:07 -07:00
parent f7d0a32045
commit 9d1816111d
2 changed files with 4 additions and 7 deletions

View File

@ -1980,13 +1980,10 @@ pub const LibExeObjStep = struct {
try zig_args.append(other.getOutputPath());
},
.Lib => {
if (!other.is_dynamic or self.target.isWindows()) {
try zig_args.append(other.getOutputLibPath());
} else {
const full_path_lib = other.getOutputPath();
try zig_args.append("--library");
try zig_args.append(full_path_lib);
const full_path_lib = other.getOutputPath();
try zig_args.append(full_path_lib);
if (other.is_dynamic and !self.target.isWindows()) {
if (fs.path.dirname(full_path_lib)) |dirname| {
try zig_args.append("-rpath");
try zig_args.append(dirname);

View File

@ -1402,7 +1402,7 @@ fn buildOutputType(
continue;
}
if (std.fs.path.isAbsolute(lib_name)) {
fatal("cannot use absolute path as a system library: {}", .{lib_name});
fatal("cannot use absolute path as a system library: {s}", .{lib_name});
}
i += 1;
}