authorgravatar for ypsvlq@gmail.comElaine Gibson <ypsvlq@gmail.com> 2024-03-20 22:14:12+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-03-21 15:05:17-07:00
loge12a72db92164dab46023dad03d10f5047477d95
treec2bfed6754621d42e6031d5dba6bf140cf122141
parentc5bd19e45edfa2989909f825269c462d1bf641b7

main: set subsystem version from target windows version


1 files changed, 10 insertions(+), 0 deletions(-)

src/main.zig+10
......@@ -2799,6 +2799,16 @@ fn buildOutputType(
27992799
28002800 const target = main_mod.resolved_target.result;
28012801
2802 if (target.os.tag == .windows and major_subsystem_version == null and minor_subsystem_version == null) {
2803 major_subsystem_version, minor_subsystem_version = switch (target.os.version_range.windows.min) {
2804 .nt4 => .{ 4, 0 },
2805 .win2k => .{ 5, 0 },
2806 .xp => if (target.cpu.arch == .x86_64) .{ 5, 2 } else .{ 5, 1 },
2807 .ws2003 => .{ 5, 2 },
2808 else => .{ null, null },
2809 };
2810 }
2811
28022812 if (target.ofmt != .coff) {
28032813 if (manifest_file != null) {
28042814 fatal("manifest file is not allowed unless the target object format is coff (Windows/UEFI)", .{});