diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-06-22 11:47:32 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-06-22 17:25:04 +0200 |
commit | e5cbbca16aae34a27934ed5c665d1ffc55dff10e (patch) | |
tree | 3eeef0addae07f2b24953f0c04f57c00b1f9daa7 /src/assistant | |
parent | f50b2c29c20ae317745c71cdbca6334e42e066e1 (diff) | |
download | qttools-e5cbbca16aae34a27934ed5c665d1ffc55dff10e.tar.gz |
Fix qhelpgenerator for static top-level builds
This tool needs the QSQLiteDriverPlugin in addition to the
QMinimalIntegrationPlugin. Update the code that imports the plugins.
This amends commit 0412da38b3d00ca4a192b0d262ad5b0e35b51503.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104490
Change-Id: I6b26b7081113e8036336cd2e19dab896f4956a3f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/assistant')
-rw-r--r-- | src/assistant/qhelpgenerator/CMakeLists.txt | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/assistant/qhelpgenerator/CMakeLists.txt b/src/assistant/qhelpgenerator/CMakeLists.txt index cdafe99df..7e1448739 100644 --- a/src/assistant/qhelpgenerator/CMakeLists.txt +++ b/src/assistant/qhelpgenerator/CMakeLists.txt @@ -24,17 +24,27 @@ qt_internal_add_tool(${target_name} qt_internal_return_unless_building_tools() if(NOT QT_BUILD_SHARED_LIBS) + set(needed_plugins + QMinimalIntegrationPlugin + QSQLiteDriverPlugin + ) + list(TRANSFORM needed_plugins PREPEND Qt:: OUTPUT_VARIABLE needed_plugin_targets) if(QT_SUPERBUILD) # In a top-level build, qt_import_plugins() is a no-op because # __qt_internal_add_static_plugins_once() is not called. # So we need to initialize and link the plugin manually. set(out_file_path "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_plugin_imports_custom.cpp") + # Create a string with the necessary Q_IMPORT_PLUGIN(...) statements. + list(TRANSFORM needed_plugins PREPEND "Q_IMPORT_PLUGIN(" OUTPUT_VARIABLE import_plugin_code) + list(TRANSFORM import_plugin_code APPEND ")") + list(JOIN import_plugin_code "\n" import_plugin_code) + file(GENERATE OUTPUT "${out_file_path}" CONTENT "// This file is auto-generated. Do not edit. #include <QtPlugin> -Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin) +${import_plugin_code} ") # CMake versions earlier than 3.18.0 can't find the generated file for some reason, @@ -43,10 +53,10 @@ Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin) set_source_files_properties("${out_file_path}" PROPERTIES GENERATED TRUE) target_sources(${target_name} PRIVATE "${out_file_path}") - target_link_libraries(${target_name} PRIVATE Qt::QMinimalIntegrationPlugin) + target_link_libraries(${target_name} PRIVATE ${needed_plugin_targets}) else() qt_import_plugins(${target_name} - INCLUDE Qt::QMinimalIntegrationPlugin + INCLUDE ${needed_plugin_targets} ) endif() endif() |