From c39d2243a07e73028badb5e0a811c0bc6ec334bc Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 28 Jan 2024 14:01:11 +0100 Subject: [PATCH] CMake: Use CEF_RUNTIME_LIBRARY_FLAG Instead of manually modifying the build flags. Because libcef_dll_wrapper uses a cached variable, we have to force a cache change. --- build/cmake/lib/webview_chromium/CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build/cmake/lib/webview_chromium/CMakeLists.txt b/build/cmake/lib/webview_chromium/CMakeLists.txt index 31a5374d97..df615746d8 100644 --- a/build/cmake/lib/webview_chromium/CMakeLists.txt +++ b/build/cmake/lib/webview_chromium/CMakeLists.txt @@ -56,18 +56,21 @@ endif() set(USE_ATL OFF) # Disable usage of ATL in CEF set(USE_SANDBOX OFF) # Disable usage of sandbox on windows +if(MSVC) + if(wxBUILD_USE_STATIC_RUNTIME) + set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "" FORCE) + else() + set(CEF_RUNTIME_LIBRARY_FLAG "/MD" CACHE STRING "" FORCE) + endif() +endif() + add_subdirectory(${CEF_ROOT} ${CEF_BUILD_DIR} EXCLUDE_FROM_ALL) set_target_properties(libcef_dll_wrapper PROPERTIES FOLDER "Third Party Libraries" OUTPUT_NAME "libcef_dll_wrapper" ) -if(MSVC) - # Modify CEF compiler options to match VC runtime - get_target_property(cef_compile_options libcef_dll_wrapper COMPILE_OPTIONS) - string(REGEX REPLACE "/MTd?;" "" cef_compile_options "${cef_compile_options}") - set_target_properties(libcef_dll_wrapper PROPERTIES COMPILE_OPTIONS "${cef_compile_options}") -else() +if(NOT MSVC) set_target_properties(libcef_dll_wrapper PROPERTIES COMPILE_OPTIONS "-Wno-extra") endif()