Commit 9d1816111d

Andrew Kelley <andrew@ziglang.org>
2020-12-01 02:11:07
build system: pass dyn lib artifacts as positionals
1 parent f7d0a32
Changed files (2)
lib
src
lib/std/build.zig
@@ -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);
src/main.zig
@@ -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;
         }