From 46e933cf0ba0582b2e60fb23d324e6c6227a3e2b Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Sun, 25 Nov 2018 15:48:43 -0500 Subject: [PATCH] cmake: Target Vista and newer We already depend on features only available in Vista and newer. Setting _WIN32_WINNT allows us to use functions like SetFileInformationByHandle. Signed-off-by: Andrew Gunnerson --- cmake/CompilerFlags.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake index 5aa84edcc..9fb026910 100644 --- a/cmake/CompilerFlags.cmake +++ b/cmake/CompilerFlags.cmake @@ -38,6 +38,9 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # Don't warn for valid msprintf specifiers add_compile_options(-Wno-pedantic-ms-format) + # Target Vista and up + add_definitions(-D_WIN32_WINNT=0x0600) + # Enable ASLR set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamicbase") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--dynamicbase")