diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-08 14:01:59 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-09 12:44:35 +0200 |
commit | 51ae235080df7f051e65883a90731685649f2957 (patch) | |
tree | b71593f9450b3e6c500a4131fb541eba3bd0931c /cmake/QtPublicPluginHelpers.cmake | |
parent | 7b3d9efc042bec4ce23a6e75553cced3d14d1542 (diff) |
CMake: Use correct MSVC runtime library for Qt object libraries
If Qt was configured with -static-runtime which implies MultiThreaded
-MT flag, the plugin initializer object libraries were still compiled
with the default -MD flag.
When an application linked to Qt, that caused linking to fail with
mismatched symbol errors between the application symbols and the
plugin initializer object library symbols.
Make sure to set the MSVC_RUNTIME_LIBRARY property on both plugin
initializer and resource object libraries, depending on the value of
QT_FEATURE_static_runtime.
We did set the property for resources added by
qt_internal_add_resource, but not for the resource created by
the public qt6_add_resources counterpart.
Pick-to: 6.2
Fixes: QTBUG-95043
Change-Id: Ia543cd0241db94a12080be2655ad420fe9ad3f24
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtPublicPluginHelpers.cmake')
-rw-r--r-- | cmake/QtPublicPluginHelpers.cmake | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cmake/QtPublicPluginHelpers.cmake b/cmake/QtPublicPluginHelpers.cmake index 919aee10c6..a765157f5f 100644 --- a/cmake/QtPublicPluginHelpers.cmake +++ b/cmake/QtPublicPluginHelpers.cmake @@ -243,6 +243,7 @@ function(__qt_internal_add_static_plugin_init_object_library # Core provides the symbols needed by Q_IMPORT_PLUGIN. ${QT_CMAKE_EXPORT_NAMESPACE}::Core ) + _qt_internal_set_up_static_runtime_library("${plugin_init_target}") set_property(TARGET ${plugin_init_target} PROPERTY _is_qt_plugin_init_target TRUE) set_property(TARGET ${plugin_init_target} APPEND PROPERTY |