@@ -57,13 +57,18 @@ add_library (https-android STATIC EXCLUDE_FROM_ALL
5757 android /AndroidClient.cpp
5858)
5959
60+ add_library (https-wininet STATIC EXCLUDE_FROM_ALL
61+ windows/WinINetClient.cpp
62+ )
63+
6064### Flags
6165if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
6266 option (USE_CURL_BACKEND "Use the libcurl backend" ON )
6367 option (USE_OPENSSL_BACKEND "Use the openssl backend" ON )
6468 option (USE_SCHANNEL_BACKEND "Use the schannel backend (windows-only)" OFF )
6569 option (USE_NSURL_BACKEND "Use the NSUrl backend (apple-only)" OFF )
6670 option (USE_ANDROID_BACKEND "Use the Android Java backend (Android-only)" OFF )
71+ option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" OFF )
6772
6873 option (USE_WINSOCK "Use winsock instead of BSD sockets (windows-only)" OFF )
6974elseif (WIN32 )
@@ -72,6 +77,7 @@ elseif (WIN32)
7277 option (USE_SCHANNEL_BACKEND "Use the schannel backend (windows-only)" ON )
7378 option (USE_NSURL_BACKEND "Use the NSUrl backend (apple-only)" OFF )
7479 option (USE_ANDROID_BACKEND "Use the Android Java backend (Android-only)" OFF )
80+ option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" ON )
7581
7682 option (USE_WINSOCK "Use winsock instead of BSD sockets (windows-only)" ON )
7783
@@ -83,6 +89,7 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
8389 option (USE_SCHANNEL_BACKEND "Use the schannel backend (windows-only)" OFF )
8490 option (USE_NSURL_BACKEND "Use the NSUrl backend (apple-only)" ON )
8591 option (USE_ANDROID_BACKEND "Use the Android Java backend (Android-only)" OFF )
92+ option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" OFF )
8693
8794 option (USE_WINSOCK "Use winsock instead of BSD sockets (windows-only)" OFF )
8895
@@ -98,6 +105,7 @@ elseif (ANDROID)
98105 option (USE_SCHANNEL_BACKEND "Use the schannel backend (windows-only)" OFF )
99106 option (USE_NSURL_BACKEND "Use the NSUrl backend (apple-only)" OFF )
100107 option (USE_ANDROID_BACKEND "Use the Android Java backend (Android-only)" ON )
108+ option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" OFF )
101109
102110 option (USE_WINSOCK "Use winsock instead of BSD sockets (windows-only)" OFF )
103111
@@ -147,6 +155,11 @@ if (USE_ANDROID_BACKEND)
147155 message (STATUS "Ensure to add the Java files to your project too!" )
148156endif ()
149157
158+ if (USE_WININET_BACKEND)
159+ set (HTTPS_BACKEND_WININET ON )
160+ target_link_libraries (https https-wininet wininet )
161+ endif ()
162+
150163if (USE_WINSOCK)
151164 set (HTTPS_USE_WINSOCK ON )
152165endif ()
0 commit comments