Skip to content

Commit

Permalink
cmake: Target Vista and newer
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chenxiaolong committed Nov 25, 2018
1 parent 8dea723 commit 46e933c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 46e933c

Please sign in to comment.