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()