summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2022-09-01 19:50:29 +0200
committerMarc Hoersken <info@marc-hoersken.de>2022-09-05 20:22:32 +0200
commit7b66050eaeb6a8dc1c4076ebaaa4437eaba899e8 (patch)
tree925d61e8703492ff855390df4139cff4e482605a /CMakeLists.txt
parent5162ba05625d941bfd1bdbc47bd25b896caa44dc (diff)
downloadcurl-7b66050eaeb6a8dc1c4076ebaaa4437eaba899e8.tar.gz
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb597ca8e..ba79d9ec7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,6 +87,7 @@ if(WIN32)
if(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(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}")
endif()
if(ENABLE_UNICODE)
add_definitions(-DUNICODE -D_UNICODE)
@@ -1166,9 +1167,8 @@ if(WIN32)
curl_internal_test(HAVE_WIN32_WINNT)
if(HAVE_WIN32_WINNT)
string(REGEX MATCH ".*_WIN32_WINNT=0x[0-9a-fA-F]+" OUTPUT "${OUTPUT}")
- string(REGEX REPLACE ".*_WIN32_WINNT=" "" OUTPUT "${OUTPUT}")
- math(EXPR HAVE_WIN32_WINNT "${OUTPUT}" OUTPUT_FORMAT DECIMAL)
- message(STATUS "Found _WIN32_WINNT=${OUTPUT} (${HAVE_WIN32_WINNT})")
+ string(REGEX REPLACE ".*_WIN32_WINNT=" "" HAVE_WIN32_WINNT "${OUTPUT}")
+ message(STATUS "Found _WIN32_WINNT=${HAVE_WIN32_WINNT}")
endif()
# avoid storing HAVE_WIN32_WINNT in CMake cache
unset(HAVE_WIN32_WINNT CACHE)