Skip to content

Commit 337414e

Browse files
authored
Add defines for gcc and clang that declare we are Windows 10 (#308)
* Add defines for gcc and clang that declare we are Windows 10 * Deduplicate setting windows cflags for clang and gcc and move to its own function
1 parent 2086d2d commit 337414e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Runner.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
333333
])
334334
end
335335
end
336+
if Sys.iswindows(p)
337+
windows_cflags!(p, flags)
338+
end
336339
return flags
337340
end
338341

@@ -458,6 +461,16 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
458461
return flags
459462
end
460463

464+
function windows_cflags!(p::AbstractPlatform, flags::Vector{String} = String[])
465+
# Declare that we are Windows 10 (0x0A00)
466+
# https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
467+
append!(flags, [
468+
"-DWINVER=0x0A00",
469+
"-D_WIN32_WINNT=0x0A00",
470+
])
471+
return flags
472+
end
473+
461474
function gcc_flags!(p::AbstractPlatform, flags::Vector{String} = String[])
462475
# Force proper cxx11 string ABI usage w00t w00t!
463476
if cxxstring_abi(p) == "cxx11"
@@ -478,6 +491,11 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
478491
if Sys.isapple(p)
479492
macos_gcc_flags!(p, flags)
480493
end
494+
495+
if Sys.iswindows(p)
496+
windows_cflags!(p, flags)
497+
end
498+
481499
return flags
482500
end
483501

0 commit comments

Comments
 (0)