Skip to content

Commit 36abe4a

Browse files
committed
Don't enable WinINet when compiling for UWP.
1 parent b4e954f commit 36abe4a

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ elseif (WIN32)
7777
option (USE_SCHANNEL_BACKEND "Use the schannel backend (windows-only)" ON)
7878
option (USE_NSURL_BACKEND "Use the NSUrl backend (apple-only)" OFF)
7979
option (USE_ANDROID_BACKEND "Use the Android Java backend (Android-only)" OFF)
80-
option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" ON)
80+
81+
if (CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
82+
option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" OFF)
83+
else ()
84+
option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" ON)
85+
endif ()
8186

8287
option (USE_WINSOCK "Use winsock instead of BSD sockets (windows-only)" ON)
8388

src/common/config.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
#include "common/config-generated.h"
55
#elif defined(WIN32) || defined(_WIN32)
66
#define HTTPS_BACKEND_SCHANNEL
7-
#define HTTPS_BACKEND_WININET
87
#define HTTPS_USE_WINSOCK
8+
#include <winapifamily.h>
9+
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
10+
// WinINet is only supported on desktop.
11+
#define HTTPS_BACKEND_WININET
12+
#endif
913
#elif defined(__ANDROID__)
1014
#define HTTPS_BACKEND_ANDROID
1115
#elif defined(__APPLE__)

0 commit comments

Comments
 (0)