summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-08-05 16:49:42 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-08-10 16:51:53 +0200
commit5161d8d525650ac74a3571b13bb8b35dbf413e59 (patch)
tree762ffeaf4ef6a0ee750677aafe8412824c466451 /cmake
parentf95a446641ac84c7756d184a7ee996fc538a18c9 (diff)
CMake: Remove qt6_enable_object_libraries_finalizer_mode
qt6_enable_object_libraries_finalizer_mode is not needed anymore now that static Qt builds require CMake 3.21 and thus CMake takes care of placing object library object files at the beginning of the link line. Rename qt6_enable_import_plugins_finalizer_mode to a more generic qt6_set_finalizer_mode that can enable or disable multiple different modes. For now the only available mode is "static_plugins" which handles the behavior of the old function name. The mode can be enabled by calling qt6_set_finalizer_mode(${target} ENABLE MODES "static_plugins") Note that the function is re-tagged as being in Technical Preview. Ideally we would not need it at all. But we need to provide some workaround for the limitations of linking Qt static plugins in CMake on Linux-y platforms that use bfd ld or ld.gold. The workaround does not work well with dependencies wrapped in generator expressions which is why we can't confidently advertise it as a proper solution. Our hope is that this can be fixed in future upstream CMake versions and the function can be removed. See 6fcc272ac9dcf1d6d65de1bdf3138722ba63a902 for details. Adjust the tests due to the renamed and removed functions. Amends 19e789bace887105badae83c0a79429bbf8e8221 Amends cdbb390c4a9b8d53cfcfd0884e6720423ce5e126 Amends a25027eecb3829a65543d0e8ab00c74e1b1a21c5 Amends 6fcc272ac9dcf1d6d65de1bdf3138722ba63a902 Amends a3c430f390b379d874916d4c9ff02af5323af1bd Pick-to: 6.2 Fixes: QTBUG-95169 Task-number: QTBUG-95601 Task-number: QTBUG-95603 Change-Id: I51b85f776ec29fc04fed1a637eba7d1f60609e69 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtPublicPluginHelpers.cmake25
1 files changed, 6 insertions, 19 deletions
diff --git a/cmake/QtPublicPluginHelpers.cmake b/cmake/QtPublicPluginHelpers.cmake
index 5023498b73..913dede6bf 100644
--- a/cmake/QtPublicPluginHelpers.cmake
+++ b/cmake/QtPublicPluginHelpers.cmake
@@ -131,7 +131,7 @@ endfunction()
# Wraps the genex condition to evaluate to true only when using the regular plugin importing mode
# (not finalizer mode).
function(__qt_internal_get_plugin_condition_regular_mode plugin_condition out_var)
- set(not_finalizer_mode "$<NOT:$<BOOL:$<TARGET_PROPERTY:_qt_static_plugins_use_finalizer_mode>>>")
+ set(not_finalizer_mode "$<NOT:$<BOOL:$<TARGET_PROPERTY:_qt_static_plugins_finalizer_mode>>>")
set(full_plugin_condition "$<AND:${plugin_condition},${not_finalizer_mode}>")
set(${out_var} "${full_plugin_condition}" PARENT_SCOPE)
endfunction()
@@ -368,17 +368,6 @@ function(__qt_internal_collect_plugin_targets_from_dependencies_of_plugins targe
set("${out_var}" "${plugin_targets}" PARENT_SCOPE)
endfunction()
-# Helper to check if the finalizer mode of plugin importing should be used.
-# If true or unset, use finalizer mode.
-# If false, use regular mode (usage requirement propagation via associated Qt module)
-function(__qt_internal_get_plugin_imports_finalizer_mode target out_var)
- get_target_property(value ${target} _qt_static_plugins_use_finalizer_mode)
- if("${value}" STREQUAL "value-NOTFOUND")
- set(value "")
- endif()
- set(${out_var} "${value}" PARENT_SCOPE)
-endfunction()
-
# Main logic of finalizer mode.
function(__qt_internal_apply_plugin_imports_finalizer_mode target)
# Nothing to do in a shared build.
@@ -392,17 +381,15 @@ function(__qt_internal_apply_plugin_imports_finalizer_mode target)
return()
endif()
- __qt_internal_get_plugin_imports_finalizer_mode(${target} use_finalizer_mode)
-
# By default if the project hasn't explicitly opted in or out, use finalizer mode.
# The precondition for this is that qt_finalize_target was called (either explicitly by the user
# or auto-deferred by CMake 3.19+).
- if("${use_finalizer_mode}" STREQUAL "")
- qt_enable_import_plugins_finalizer_mode(${target} TRUE)
- endif()
+ __qt_internal_check_finalizer_mode("${target}"
+ use_finalizer_mode
+ static_plugins
+ DEFAULT_VALUE "TRUE"
+ )
- # Check if the project chose a mode explicitly.
- __qt_internal_get_plugin_imports_finalizer_mode(${target} use_finalizer_mode)
if(NOT use_finalizer_mode)
return()
endif()