Assume release CEF build by default under Unix

This prevents wxWebViewChromium from referencing debug-only functions
that are not defined in the release build of libcef_dll_wrapper.

Unfortunately, CEF build doesn't provide any way to detect if the
wrappers were built in debug or in release mode, so just assume the
latter and add --enable-cef-debug configure option to build with a debug
build of CEF wrapper if necessary.
This commit is contained in:
Vadim Zeitlin 2023-09-19 00:36:07 +02:00
parent b5e278c0eb
commit 4816448cff
5 changed files with 71 additions and 1 deletions

View file

@ -789,6 +789,11 @@ dnl This one is not enabled by default as it requires CEF to be available under
dnl 3rdparty/cef.
WX_ARG_ENABLE(webviewchromium, [ --enable-webviewchromium use wxWebView Chromium backend], wxUSE_WEBVIEW_CHROMIUM)
dnl When using wxWebViewChromium, we assume that CEF wrapper DLL was built in
dnl release mode, use this option if it was built in debug one, i.e. with
dnl -DCMAKE_BUILD_TYPE=Debug
WX_ARG_ENABLE(cef_debug, [ --enable-cef_debug use debug build of CEF wrapper], wxUSE_CEF_DEBUG)
dnl wxDC is implemented in terms of wxGraphicsContext in wxOSX so the latter
dnl can't be disabled, don't even provide an option to do it
if test "$wxUSE_MAC" != 1; then
@ -6971,6 +6976,12 @@ if test "$wxUSE_WEBVIEW" = "yes"; then
wxUSE_WEBVIEW="yes"
USE_WEBVIEW_CHROMIUM=1
AC_DEFINE(wxUSE_WEBVIEW_CHROMIUM)
dnl Just trust the option value, we don't really have any simple
dnl way to check the CEF wrapper DLL build type.
if test "$wxUSE_CEF_DEBUG" = "yes"; then
AC_DEFINE(wxHAVE_CEF_DEBUG)
fi
else
AC_MSG_ERROR([CEF not detected: $cef_error