]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Use a string option WINDOWS_VERSION to set WINVER and _WIN32_WINNT in Windows build.
authorAndres Mejia <amejia004@gmail.com>
Fri, 1 Feb 2013 23:46:30 +0000 (18:46 -0500)
committerAndres Mejia <amejia004@gmail.com>
Fri, 1 Feb 2013 23:46:30 +0000 (18:46 -0500)
This will allow using WINVER for VISTA and up so that crypto checks for SHA256, SHA384, and SHA512
will pass.

CMakeLists.txt

index e8a0bd989181c6f1f0ccf499d30c18ca6bd30576..ac9186e99e2bfff8584856e5d20a93626a6b68f3 100644 (file)
@@ -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)