Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Commit bcd711f

Browse files
committed
Make sure that CURL_TARGET_WINDOWS_VERSION is always defined
1 parent 275d6c3 commit bcd711f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

_Build.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,12 @@ set CMAKE_CURL_VARIABLES=!CMAKE_CURL_VARIABLES! ^
683683

684684
if /i "%CONFIG%" equ "Debug" set CMAKE_CURL_VARIABLES=!CMAKE_CURL_VARIABLES! -DENABLE_CURLDEBUG=ON -DENABLE_DEBUG=ON -DCMAKE_DEBUG_POSTFIX:STRING=""
685685

686+
REM | CURL requires valid CURL_TARGET_WINDOWS_VERSION
687+
REM | https://github.com/curl/curl/issues/9406
688+
for /f "usebackq delims=*" %%s in (`powershell -ExecutionPolicy bypass -Command "if ('!BUILD_C_FLAGS!' -match '-D_WIN32_WINNT=(?<hexver>0x[0-9a-fA-F]+)') { $Matches.hexver }"`) do set CURL_TARGET_WINDOWS_VERSION=%%s
689+
if "%CURL_TARGET_WINDOWS_VERSION%" equ "" set CURL_TARGET_WINDOWS_VERSION=0x0601
690+
set CMAKE_CURL_VARIABLES=!CMAKE_CURL_VARIABLES! -DCURL_TARGET_WINDOWS_VERSION=%CURL_TARGET_WINDOWS_VERSION%
691+
686692
REM | curl(static CRT)
687693
if /i "%BUILDER%" equ "MSVC" (
688694
if /i "%CRT%" equ "static" set CMAKE_CURL_VARIABLES=!CMAKE_CURL_VARIABLES! -DCURL_STATIC_CRT=ON

0 commit comments

Comments
 (0)