zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 8ced903d617c85f3288182c95a2e29b7166fbc55 (tree)
parent 72dd22f262353fa7d37c89c7d163e97a162abb9b
Author: Matteo Briani <47302999+matteo-briani@users.noreply.github.com>
Date:   Sat, 24 Jun 2023 22:24:50 +0200

Add support for the "--version" linker argument (#16154)

closes #15549

Co-authored-by: Matteo Briani <matteo.briani@icvox.com>
Diffstat:
Msrc/main.zig | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/main.zig b/src/main.zig @@ -2211,6 +2211,9 @@ fn buildOutputType( fatal("unable to parse /version '{s}': {s}", .{ arg, @errorName(err) }); }; have_version = true; + } else if (mem.eql(u8, arg, "--version")) { + try std.io.getStdOut().writeAll("zig ld " ++ build_options.version ++ "\n"); + process.exit(0); } else { fatal("unsupported linker arg: {s}", .{arg}); }