Consider the qt_internal_extend_target calls when adding deps on qpa_default_plugins
Applications not necessarly link QtGui module in qt_internal_add_executable. They still may add link it in followoup qt_internal_extend_target calls. We should consider this when adding dependencies on qpa_default_plugins to the internal executables. Pick-to: 6.7 Change-Id: Icc413bd35b631b3a356e4033faab4e6c01b29a60 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
1e8a36e360
commit
c5be402651
@ -207,15 +207,6 @@ function(qt_internal_add_executable name)
|
|||||||
ADDITIONAL_INSTALL_ARGS ${additional_install_args})
|
ADDITIONAL_INSTALL_ARGS ${additional_install_args})
|
||||||
qt_internal_install_pdb_files(${name} "${arg_INSTALL_DIRECTORY}")
|
qt_internal_install_pdb_files(${name} "${arg_INSTALL_DIRECTORY}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If linking against Gui, make sure to also build the default QPA plugin.
|
|
||||||
# This makes the experience of an initial Qt configuration to build and run one single
|
|
||||||
# test / executable nicer.
|
|
||||||
get_target_property(linked_libs "${name}" LINK_LIBRARIES)
|
|
||||||
if(linked_libs MATCHES "(^|;)(${QT_CMAKE_EXPORT_NAMESPACE}::|Qt::)?Gui($|;)" AND
|
|
||||||
TARGET qpa_default_plugins)
|
|
||||||
add_dependencies("${name}" qpa_default_plugins)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# This function compiles the target at configure time the very first time and creates the custom
|
# This function compiles the target at configure time the very first time and creates the custom
|
||||||
|
@ -277,9 +277,18 @@ function(qt_internal_extend_target target)
|
|||||||
_qt_extra_linker_script_exports "${arg_EXTRA_LINKER_SCRIPT_EXPORTS}")
|
_qt_extra_linker_script_exports "${arg_EXTRA_LINKER_SCRIPT_EXPORTS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# For executables collect static plugins that these targets depend on.
|
|
||||||
if(is_executable)
|
if(is_executable)
|
||||||
qt_internal_import_plugins(${target} ${arg_PUBLIC_LIBRARIES} ${arg_LIBRARIES})
|
# If linking against Gui, make sure to also build the default QPA plugin.
|
||||||
|
# This makes the experience of an initial Qt configuration to build and run one single
|
||||||
|
# test / executable nicer.
|
||||||
|
set(linked_libs ${arg_PUBLIC_LIBRARIES} ${arg_LIBRARIES})
|
||||||
|
if(linked_libs MATCHES "(^|;)(${QT_CMAKE_EXPORT_NAMESPACE}::|Qt::)?Gui($|;)" AND
|
||||||
|
TARGET qpa_default_plugins)
|
||||||
|
add_dependencies("${target}" qpa_default_plugins)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# For executables collect static plugins that these targets depend on.
|
||||||
|
qt_internal_import_plugins(${target} ${linked_libs})
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user