diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake index ae73ee5aa79..ec7782fa9e8 100644 --- a/cmake/QtPluginHelpers.cmake +++ b/cmake/QtPluginHelpers.cmake @@ -339,7 +339,8 @@ function(qt_internal_add_plugin target) if(target_type STREQUAL STATIC_LIBRARY) if(qt_module_target) - qt_internal_link_internal_platform_for_object_library("${plugin_init_target}") + qt_internal_link_internal_platform_for_object_library("${plugin_init_target}" + PARENT_TARGET "${target}") endif() endif() diff --git a/cmake/QtResourceHelpers.cmake b/cmake/QtResourceHelpers.cmake index 2df1fed50fa..02f047678dd 100644 --- a/cmake/QtResourceHelpers.cmake +++ b/cmake/QtResourceHelpers.cmake @@ -111,7 +111,8 @@ function(qt_internal_record_rcc_object_files target resource_targets) endif() set_property(TARGET ${target} APPEND PROPERTY _qt_rcc_objects "${rcc_object_file_path}") - qt_internal_link_internal_platform_for_object_library("${out_target}") + qt_internal_link_internal_platform_for_object_library("${out_target}" + PARENT_TARGET "${target}") endforeach() endfunction() diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index af840bb3e44..683b3c1af03 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -1457,6 +1457,7 @@ function(qt_internal_is_target_skipped_for_examples target out_var) endfunction() function(qt_internal_link_internal_platform_for_object_library target) + cmake_parse_arguments(arg "" "PARENT_TARGET" "" ${ARGN}) # We need to apply iOS bitcode flags to object libraries that are associated with internal # modules or plugins (e.g. object libraries added by qt_internal_add_resource, # qt_internal_add_plugin, etc.) @@ -1464,6 +1465,13 @@ function(qt_internal_link_internal_platform_for_object_library target) # present by default. # Achieve this by compiling the cpp files with the PlatformModuleInternal compile flags. target_link_libraries("${target}" PRIVATE Qt::PlatformModuleInternal) + + if(arg_PARENT_TARGET AND TARGET "${arg_PARENT_TARGET}") + foreach(property QT_SKIP_WARNINGS_ARE_ERRORS _qt_internal_use_exceptions) + set_property(TARGET "${target}" PROPERTY + ${property} "$>") + endforeach() + endif() endfunction() # Use ${dep_target}'s include dirs when building ${target}.