diff options
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 47d0125ffb..c1cfe4613c 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -4880,6 +4880,14 @@ pub fn addCCArgs( const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); + if (target.os.tag == .windows) switch (ext) { + .c, .cpp, .m, .mm, .h, .cu, .rc, .assembly, .assembly_with_cpp => { + const minver: u16 = @truncate(@intFromEnum(target.os.getVersionRange().windows.min) >> 16); + try argv.append(try std.fmt.allocPrint(argv.allocator, "-D_WIN32_WINNT=0x{x:0>4}", .{minver})); + }, + else => {}, + }; + switch (ext) { .c, .cpp, .m, .mm, .h, .cu, .rc => { try argv.appendSlice(&[_][]const u8{ |
