From 75226d4cdc7463626fd7106990f359284279dbb2 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sat, 24 Feb 2024 20:48:34 +0100 Subject: [PATCH] CMake: Apply libcef_dll_wrapper Release flags to other release configs --- .../cmake/lib/webview_chromium/CMakeLists.txt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/build/cmake/lib/webview_chromium/CMakeLists.txt b/build/cmake/lib/webview_chromium/CMakeLists.txt index 685954936b..26607705d7 100644 --- a/build/cmake/lib/webview_chromium/CMakeLists.txt +++ b/build/cmake/lib/webview_chromium/CMakeLists.txt @@ -102,6 +102,31 @@ if(NOT MSVC) target_compile_options(libcef_dll_wrapper PRIVATE "-Wno-extra") endif() +# libcef_dll_wrapper only sets properties for Debug and Release. +# Extract the release options/flags and apply them to RelWithDebInfo and MinSizeRel. +macro(rls_flags property) + get_target_property(props libcef_dll_wrapper ${property}) + string(FIND "${props}" "$:" index) + math(EXPR index "${index}+18") + string(SUBSTRING "${props}" ${index} -1 props) + string(FIND "${props}" ">" index) + string(SUBSTRING "${props}" 0 ${index} props) + if ("${property}" STREQUAL "COMPILE_DEFINITIONS") + target_compile_definitions(libcef_dll_wrapper PRIVATE + $<$:${props}> + $<$:${props}> + ) + else() + target_compile_options(libcef_dll_wrapper PRIVATE + $<$:${props}> + $<$:${props}> + ) + endif() +endmacro() +rls_flags(COMPILE_DEFINITIONS) +rls_flags(COMPILE_OPTIONS) + + add_library(libcef SHARED IMPORTED GLOBAL) if(APPLE) set_target_properties(libcef PROPERTIES