From 4b234e8bf8a0f6a42400635ee784b02d160b95e4 Mon Sep 17 00:00:00 2001 From: Andres Mejia Date: Fri, 1 Feb 2013 18:46:30 -0500 Subject: [PATCH] Use a string option WINDOWS_VERSION to set WINVER and _WIN32_WINNT in Windows build. This will allow using WINVER for VISTA and up so that crypto checks for SHA256, SHA384, and SHA512 will pass. --- CMakeLists.txt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8a0bd989..ac9186e99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,17 +153,26 @@ OPTION(ENABLE_ICONV "Enable iconv support" ON) OPTION(ENABLE_PCREPOSIX "Enable POSIX regular expression support using PCRE" OFF) OPTION(ENABLE_TEST "Enable unit and regression tests" ON) SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)") +SET(WINDOWS_VERSION "WINXP" CACHE STRING "Set Windows version to use (Windows only)") IF(ENABLE_TEST) ENABLE_TESTING() ENDIF(ENABLE_TEST) IF(WIN32) - IF(MSVC60) - SET(WINVER 0x0400) - ELSE() - SET(WINVER 0x0500) - ENDIF() + IF(WINDOWS_VERSION STREQUAL "WIN8") + SET(WINVER 0x0602) + ELSEIF(WINDOWS_VERSION STREQUAL "WIN7") + SET(WINVER 0x0601) + ELSEIF(WINDOWS_VERSION STREQUAL "WS08") + SET(WINVER 0x0600) + ELSEIF(WINDOWS_VERSION STREQUAL "VISTA") + SET(WINVER 0x0600) + ELSEIF(WINDOWS_VERSION STREQUAL "WS03") + SET(WINVER 0x0502) + ELSE(WINDOWS_VERSION STREQUAL "WIN8") + SET(WINVER 0x0501) + ENDIF(WINDOWS_VERSION STREQUAL "WIN8") SET(_WIN32_WINNT ${WINVER}) ENDIF(WIN32) -- 2.47.2