mirror of
https://github.com/curl/curl.git
synced 2026-08-26 05:33:38 +03:00
cmake: skip superfluous hex2dec conversion using math expr
CMake seems to be able to compare two hex values just fine. Also make sure CURL_TARGET_WINDOWS_VERSION is respected. Assisted-by: Marcel Raad Reviewed-by: Viktor Szakats Reported-by: Keitagit-kun on github Follow up to #9312 Fixes #9406 Closes #9411
This commit is contained in:
parent
5162ba0562
commit
7b66050eae
1 changed files with 3 additions and 3 deletions
|
|
@ -87,6 +87,7 @@ if(WIN32)
|
||||||
if(CURL_TARGET_WINDOWS_VERSION)
|
if(CURL_TARGET_WINDOWS_VERSION)
|
||||||
add_definitions(-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION})
|
add_definitions(-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION})
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}")
|
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}")
|
||||||
|
set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
if(ENABLE_UNICODE)
|
if(ENABLE_UNICODE)
|
||||||
add_definitions(-DUNICODE -D_UNICODE)
|
add_definitions(-DUNICODE -D_UNICODE)
|
||||||
|
|
@ -1166,9 +1167,8 @@ if(WIN32)
|
||||||
curl_internal_test(HAVE_WIN32_WINNT)
|
curl_internal_test(HAVE_WIN32_WINNT)
|
||||||
if(HAVE_WIN32_WINNT)
|
if(HAVE_WIN32_WINNT)
|
||||||
string(REGEX MATCH ".*_WIN32_WINNT=0x[0-9a-fA-F]+" OUTPUT "${OUTPUT}")
|
string(REGEX MATCH ".*_WIN32_WINNT=0x[0-9a-fA-F]+" OUTPUT "${OUTPUT}")
|
||||||
string(REGEX REPLACE ".*_WIN32_WINNT=" "" OUTPUT "${OUTPUT}")
|
string(REGEX REPLACE ".*_WIN32_WINNT=" "" HAVE_WIN32_WINNT "${OUTPUT}")
|
||||||
math(EXPR HAVE_WIN32_WINNT "${OUTPUT}" OUTPUT_FORMAT DECIMAL)
|
message(STATUS "Found _WIN32_WINNT=${HAVE_WIN32_WINNT}")
|
||||||
message(STATUS "Found _WIN32_WINNT=${OUTPUT} (${HAVE_WIN32_WINNT})")
|
|
||||||
endif()
|
endif()
|
||||||
# avoid storing HAVE_WIN32_WINNT in CMake cache
|
# avoid storing HAVE_WIN32_WINNT in CMake cache
|
||||||
unset(HAVE_WIN32_WINNT CACHE)
|
unset(HAVE_WIN32_WINNT CACHE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue