diff options
| author | Joerg Bornemann <joerg.bornemann@qt.io> | 2025-11-28 10:07:54 +0100 |
|---|---|---|
| committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2025-12-15 13:42:42 +0100 |
| commit | 91b0f435046052ffcd656be23e11ee204bfd3fe5 (patch) | |
| tree | 99899d7d439e1cd394d1bec54ec7b47ee118f747 | |
| parent | 07722835bd491dab32383e0979af61ffca3a9b4e (diff) | |
CMake: Don't yield error if qwebengine_convert_dict is unavailable
Consider a cross-build of QtWebEngine where the host build doesn't
provide the qwebengine_convert_dict tool. We have this situation on the
CI where a MinGW build of the qtwebengine repo is used for the host and
MSVC arm64 for the target.
Check if the qwebengine_convert_dict target is available and bail out
with a warning if it's not.
Change-Id: I448d2a1bb64781d3847bb685f8f8a3fbe8cbd35e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| -rw-r--r-- | src/core/api/Qt6WebEngineCoreMacros.cmake | 7 | ||||
| -rw-r--r-- | tests/auto/widgets/CMakeLists.txt | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/core/api/Qt6WebEngineCoreMacros.cmake b/src/core/api/Qt6WebEngineCoreMacros.cmake index 8bb731548..ed58aa8e7 100644 --- a/src/core/api/Qt6WebEngineCoreMacros.cmake +++ b/src/core/api/Qt6WebEngineCoreMacros.cmake @@ -14,6 +14,13 @@ function(qt6_add_webengine_dictionary) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + if(NOT TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict) + message(WARNING + "qwebengine_convert_dict is not available. Skipping qt6_add_webengine_dictionary." + ) + return() + endif() + if (NOT ARGS_SOURCE OR NOT EXISTS "${ARGS_SOURCE}" OR NOT IS_ABSOLUTE "${ARGS_SOURCE}") message(FATAL_ERROR "Function qt_add_webengine_dictionary requires an absolute path to SOURCE dictionary.") endif() diff --git a/tests/auto/widgets/CMakeLists.txt b/tests/auto/widgets/CMakeLists.txt index 2195dd5e6..f6a50cc03 100644 --- a/tests/auto/widgets/CMakeLists.txt +++ b/tests/auto/widgets/CMakeLists.txt @@ -29,7 +29,9 @@ endif() if(QT_FEATURE_webengine_printing_and_pdf) add_subdirectory(printing) endif() -if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING AND NOT QT_FEATURE_webengine_native_spellchecker) +if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING + AND NOT QT_FEATURE_webengine_native_spellchecker + AND TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict) add_subdirectory(spellchecking) endif() if(QT_FEATURE_webengine_extensions) |
