Skip to content

Commit b4e954f

Browse files
committed
Boilerplate code for WinINet.
1 parent 34035b6 commit b4e954f

5 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
6165
if (${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)
6974
elseif (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!")
148156
endif ()
149157

158+
if (USE_WININET_BACKEND)
159+
set(HTTPS_BACKEND_WININET ON)
160+
target_link_libraries (https https-wininet wininet)
161+
endif ()
162+
150163
if (USE_WINSOCK)
151164
set(HTTPS_USE_WINSOCK ON)
152165
endif ()

src/common/config-generated.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
#cmakedefine HTTPS_BACKEND_SCHANNEL
44
#cmakedefine HTTPS_BACKEND_NSURL
55
#cmakedefine HTTPS_BACKEND_ANDROID
6+
#cmakedefine HTTPS_BACKEND_WININET
67
#cmakedefine HTTPS_USE_WINSOCK
78
#cmakedefine DEBUG_SCHANNEL

src/common/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "common/config-generated.h"
55
#elif defined(WIN32) || defined(_WIN32)
66
#define HTTPS_BACKEND_SCHANNEL
7+
#define HTTPS_BACKEND_WININET
78
#define HTTPS_USE_WINSOCK
89
#elif defined(__ANDROID__)
910
#define HTTPS_BACKEND_ANDROID

src/windows/WinINetClient.cpp

Whitespace-only changes.

src/windows/WinINetClient.h

Whitespace-only changes.

0 commit comments

Comments
 (0)