CMake: Enable wxUSE_WEBVIEW_EDGE when WebView2 SDK is detected

Only for MSVC >1800 (Visual Studio 2017, vc140) and later.
This commit is contained in:
Maarten Bent
2021-01-19 22:42:42 +01:00
parent 71c4653b94
commit c8a71bc631
2 changed files with 18 additions and 8 deletions

View File

@@ -453,6 +453,10 @@ if(wxUSE_GUI)
wx_option_force_value(wxUSE_WEBVIEW OFF) wx_option_force_value(wxUSE_WEBVIEW OFF)
endif() endif()
elseif(WXMSW) elseif(WXMSW)
if(wxUSE_WEBVIEW_EDGE AND NOT EXISTS "${wxSOURCE_DIR}/3rdparty/webview2")
message("WebView2 SDK not found, WebviewEdge won't be available")
wx_option_force_value(wxUSE_WEBVIEW_EDGE OFF)
endif()
if(NOT wxUSE_WEBVIEW_IE AND NOT wxUSE_WEBVIEW_EDGE) if(NOT wxUSE_WEBVIEW_IE AND NOT wxUSE_WEBVIEW_EDGE)
message(WARNING "WebviewIE and WebviewEdge not found or enabled, wxWebview won't be available") message(WARNING "WebviewIE and WebviewEdge not found or enabled, wxWebview won't be available")
wx_option_force_value(wxUSE_WEBVIEW OFF) wx_option_force_value(wxUSE_WEBVIEW OFF)

View File

@@ -435,6 +435,18 @@ wx_option(wxUSE_ICO_CUR "use Windows ICO and CUR formats")
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
if(WIN32) if(WIN32)
if(MSVC_VERSION GREATER 1600 AND NOT CMAKE_VS_PLATFORM_TOOLSET MATCHES "_xp$")
set(wxUSE_WINRT_DEFAULT ON)
else()
set(wxUSE_WINRT_DEFAULT OFF)
endif()
if(MSVC_VERSION GREATER 1800 AND NOT CMAKE_VS_PLATFORM_TOOLSET MATCHES "_xp$")
set(wxUSE_WEBVIEW_EDGE_DEFAULT ON)
else()
set(wxUSE_WEBVIEW_EDGE_DEFAULT OFF)
endif()
wx_option(wxUSE_ACCESSIBILITY "enable accessibility support")
wx_option(wxUSE_ACTIVEX " enable wxActiveXContainer class (Win32 only)") wx_option(wxUSE_ACTIVEX " enable wxActiveXContainer class (Win32 only)")
wx_option(wxUSE_CRASHREPORT "enable wxCrashReport::Generate() to create mini dumps (Win32 only)") wx_option(wxUSE_CRASHREPORT "enable wxCrashReport::Generate() to create mini dumps (Win32 only)")
wx_option(wxUSE_DC_CACHEING "cache temporary wxDC objects (Win32 only)") wx_option(wxUSE_DC_CACHEING "cache temporary wxDC objects (Win32 only)")
@@ -444,16 +456,10 @@ if(WIN32)
wx_option(wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW "use PS printing in wxMSW (Win32 only)") wx_option(wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW "use PS printing in wxMSW (Win32 only)")
wx_option(wxUSE_TASKBARICON_BALLOONS "enable wxTaskBarIcon::ShowBalloon() method (Win32 only)") wx_option(wxUSE_TASKBARICON_BALLOONS "enable wxTaskBarIcon::ShowBalloon() method (Win32 only)")
wx_option(wxUSE_UXTHEME "enable support for Windows XP themed look (Win32 only)") wx_option(wxUSE_UXTHEME "enable support for Windows XP themed look (Win32 only)")
wx_option(wxUSE_WEBVIEW_EDGE "use wxWebView Edge (Chromium) backend (Windows 7+ only)" ${wxUSE_WEBVIEW_EDGE_DEFAULT})
wx_option(wxUSE_WEBVIEW_IE "use wxWebView IE backend (Win32 only)") wx_option(wxUSE_WEBVIEW_IE "use wxWebView IE backend (Win32 only)")
wx_option(wxUSE_WEBVIEW_EDGE "use wxWebView Edge (Chromium) backend (Windows 7+ only)" OFF)
wx_option(wxUSE_WXDIB "use wxDIB class (Win32 only)")
if(MSVC_VERSION GREATER 1600 AND NOT CMAKE_VS_PLATFORM_TOOLSET MATCHES "_xp$")
set(wxUSE_WINRT_DEFAULT ON)
else()
set(wxUSE_WINRT_DEFAULT OFF)
endif()
wx_option(wxUSE_WINRT "enable WinRT support" ${wxUSE_WINRT_DEFAULT}) wx_option(wxUSE_WINRT "enable WinRT support" ${wxUSE_WINRT_DEFAULT})
wx_option(wxUSE_ACCESSIBILITY "enable accessibility support") wx_option(wxUSE_WXDIB "use wxDIB class (Win32 only)")
endif() endif()
# this one is not really MSW-specific but it exists mainly to be turned off # this one is not really MSW-specific but it exists mainly to be turned off