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.
This commit is contained in:
Maarten Bent 2024-01-28 14:01:11 +01:00
parent cd7e6308cd
commit c39d2243a0
No known key found for this signature in database
GPG key ID: 58AAEE3F4A4FD070

View file

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