zig ld: handle -v linker arg

The "-v" argument is the same as "--version", but the linker should
not exit after the version is printed.
This commit is contained in:
Aikawa Yataro 2024-07-06 02:05:55 +00:00
parent bf588f67d8
commit 3a22ad7035
No known key found for this signature in database
GPG Key ID: 1C5D95FB10179404

View File

@ -2475,6 +2475,8 @@ fn buildOutputType(
fatal("unable to parse /version '{s}': {s}", .{ arg, @errorName(err) });
};
have_version = true;
} else if (mem.eql(u8, arg, "-v")) {
try std.io.getStdOut().writeAll("zig ld " ++ build_options.version ++ "\n");
} else if (mem.eql(u8, arg, "--version")) {
try std.io.getStdOut().writeAll("zig ld " ++ build_options.version ++ "\n");
process.exit(0);