Check for winhttp.h presence in CMake too

This commit is contained in:
Maarten Bent
2020-12-13 16:35:34 +01:00
committed by Vadim Zeitlin
parent c6b83194f1
commit ab795fa68c

View File

@@ -308,16 +308,30 @@ if(wxUSE_LIBLZMA)
endif()
endif()
if(wxUSE_WEBREQUEST_CURL)
find_package(CURL)
if(NOT CURL_FOUND)
message(WARNING "CURL not found, wxWebSessionBackendCURL won't be available")
wx_option_force_value(wxUSE_WEBREQUEST_CURL OFF)
if (wxUSE_WEBREQUEST)
if(wxUSE_WEBREQUEST_CURL)
find_package(CURL)
if(NOT CURL_FOUND)
message(WARNING "CURL not found, wxWebSessionBackendCURL won't be available")
wx_option_force_value(wxUSE_WEBREQUEST_CURL OFF)
endif()
endif()
if(wxUSE_WEBREQUEST_WINHTTP)
check_c_source_compiles("#include <windows.h>
#include <winhttp.h>
int main(){return 0;}"
HAVE_WINHTTP_H)
if(NOT HAVE_WINHTTP_H)
message(WARNING "winhttp.h not found, wxWebSessionBackendWinHTTP won't be available")
wx_option_force_value(wxUSE_WEBREQUEST_WINHTTP OFF)
endif()
endif()
if (NOT(wxUSE_WEBREQUEST_WINHTTP OR wxUSE_WEBREQUEST_URLSESSION OR wxUSE_WEBREQUEST_CURL))
message(WARNING "wxUSE_WEBREQUEST requires at least one backend, it won't be available")
wx_option_force_value(wxUSE_WEBREQUEST OFF)
endif()
endif()
if (wxUSE_WEBREQUEST AND NOT (wxUSE_WEBREQUEST_WINHTTP OR wxUSE_WEBREQUEST_URLSESSION OR wxUSE_WEBREQUEST_CURL))
message(WARNING "wxUSE_WEBREQUEST requires at least one backend, it won't be available")
wx_option_force_value(wxUSE_WEBREQUEST OFF)
endif()
if(UNIX)