Prechádzať zdrojové kódy

Don't enable WinINet when compiling for UWP.

Miku AuahDark 2 rokov pred
rodič
commit
36abe4a798
2 zmenil súbory, kde vykonal 11 pridanie a 2 odobranie
  1. 6 1
      src/CMakeLists.txt
  2. 5 1
      src/common/config.h

+ 6 - 1
src/CMakeLists.txt

@@ -77,7 +77,12 @@ elseif (WIN32)
 	option (USE_SCHANNEL_BACKEND "Use the schannel backend (windows-only)" ON)
 	option (USE_NSURL_BACKEND "Use the NSUrl backend (apple-only)" OFF)
 	option (USE_ANDROID_BACKEND "Use the Android Java backend (Android-only)" OFF)
-	option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" ON)
+
+	if (CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+		option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" OFF)
+	else ()
+		option (USE_WININET_BACKEND "Use the WinINet backend (windows-only)" ON)
+	endif ()
 
 	option (USE_WINSOCK "Use winsock instead of BSD sockets (windows-only)" ON)
 

+ 5 - 1
src/common/config.h

@@ -4,8 +4,12 @@
 	#include "common/config-generated.h"
 #elif defined(WIN32) || defined(_WIN32)
 	#define HTTPS_BACKEND_SCHANNEL
-	#define HTTPS_BACKEND_WININET
 	#define HTTPS_USE_WINSOCK
+	#include <winapifamily.h>
+	#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
+		// WinINet is only supported on desktop.
+		#define HTTPS_BACKEND_WININET
+	#endif
 #elif defined(__ANDROID__)
 	#define HTTPS_BACKEND_ANDROID
 #elif defined(__APPLE__)