summaryrefslogtreecommitdiff
path: root/src/assistant
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-07-22 16:54:49 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-07-25 09:35:11 +0200
commitefa979b053d0084632bdff6b1d0d9860fd881ced (patch)
tree827267400b0f00cdc8ab407bf00759fd4dd6ece7 /src/assistant
parenteed008a62ac879af85f143dbc36b15e2d10e27e0 (diff)
downloadqttools-efa979b053d0084632bdff6b1d0d9860fd881ced.tar.gz
CMake: Fix build with system litehtml and gumbo
We can't set compiler flags on already built targets. Only set them conditionally on if the targets are available in the assistant subdirectory scope. They will only be available there when litehtml is built as part of qttools itself. Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-105130 Change-Id: Ie56ecf2b453d03147dde95aa04434a988febd4da Reviewed-by: Moody Liu <mooodyhunter@outlook.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/assistant')
-rw-r--r--src/assistant/CMakeLists.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/assistant/CMakeLists.txt b/src/assistant/CMakeLists.txt
index e9b2146ef..868eefdad 100644
--- a/src/assistant/CMakeLists.txt
+++ b/src/assistant/CMakeLists.txt
@@ -31,10 +31,18 @@ endif()
add_subdirectory(qlitehtml/src EXCLUDE_FROM_ALL)
if(TARGET qlitehtml)
qt_autogen_tools_initial_setup(qlitehtml)
- qt_internal_set_exceptions_flags(litehtml OFF)
- qt_disable_warnings(litehtml)
+ # The litehtml and gumbo targets will not be available here if they are not built by Qt
+ # but found in the system, because they are imported only to the subdirectory scope
+ # where find_package was called. But that's fine, we wouldn't be able to set compiler flags
+ # on them anyway.
+ if(TARGET litehtml)
+ qt_internal_set_exceptions_flags(litehtml OFF)
+ qt_disable_warnings(litehtml)
+ endif()
+ if(TARGET gumbo)
+ qt_disable_warnings(gumbo)
+ endif()
qt_disable_warnings(qlitehtml)
- qt_disable_warnings(gumbo)
qt_handle_multi_config_output_dirs(qlitehtml)
set_target_properties(qlitehtml PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_BINDIR}"