Skip to content

Commit a00a5dc

Browse files
committed
Attempting to address issues on windows
Signed-off-by: Matthew A Johnson <matjoh@microsoft.com>
1 parent 6e4f8e4 commit a00a5dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/vcpkg-consumer/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ if(TARGET snmalloc::snmallocshim-static)
1616
add_executable(test-static-shim test_static_shim.cpp)
1717
target_link_libraries(test-static-shim PRIVATE snmalloc::snmallocshim-static)
1818
add_test(NAME static-shim COMMAND test-static-shim)
19+
20+
if (WIN32)
21+
set(WIN8COMPAT FALSE CACHE BOOL "Avoid Windows 10 APIs")
22+
target_compile_definitions(test-static-shim INTERFACE $<$<BOOL:${WIN8COMPAT}>:WINVER=0x0603>)
23+
# VirtualAlloc2 is exposed by mincore.lib, not Kernel32.lib (as the
24+
# documentation says)
25+
target_link_libraries(test-static-shim INTERFACE $<$<NOT:$<BOOL:${WIN8COMPAT}>>:mincore>)
26+
message(STATUS "test-static-shim: Avoiding Windows 10 APIs is ${WIN8COMPAT}")
27+
endif()
1928
endif()

0 commit comments

Comments
 (0)