summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-08-05 14:56:51 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-08-06 19:19:46 +0200
commitd50a7d635ca20fa76d289bb2b043bc0177505703 (patch)
treebc4ffbee377e4154ebec39fbd4eb0449421d7954 /cmake/QtBuild.cmake
parent9a900dfb0794a24b9930fe75c7f0e8f208ca6be9 (diff)
CMake: Fix prl files of static Qt builds
Static Qt plugins should not be included in the list of libraries of a prl file. They end up being there due to our circular dependency trick where the plugins depend on the module they belong to. This in turn causes the giant static plugin generator expressions to be processed in qt_collect_libs(), and the generated prl file ends up having target names like Qt6::QJpegPlugin which are obviously not linker flags. To eliminate the static plugins from prl files, add an additional dummy boolean generator expression '$<BOOL:QT_IS_PLUGIN_GENEX>' that always evaluates to true. We can string match on this expression in qt_collect_libs, and thus remove the whole static plugin genex entry. This should fix linking of apps with qmake that use a CMake-built static Qt. Task-number: QTBUG-85865 Task-number: QTBUG-85240 Task-number: QTBUG-85801 Change-Id: I949dc5edb10d94c4ab84ed430af7c164d8efaaa6 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index cac9e22c73..982ac52c5a 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -3247,6 +3247,12 @@ function(qt_internal_walk_libs target out_var dict_name operation)
lib "${lib}")
endwhile()
+ # Skip static plugins.
+ set(_is_plugin_marker_genex "\\$<BOOL:QT_IS_PLUGIN_GENEX>")
+ if(lib MATCHES "${_is_plugin_marker_genex}")
+ continue()
+ endif()
+
if(lib MATCHES "^\\$<TARGET_OBJECTS:")
# Skip object files.
continue()