From c29029c4cdee85a4c04acaf30e2e085fe57867ed Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 7 Dec 2023 13:49:15 +0100 Subject: [PATCH] CMake: Fix generation of target deployment information The _qt_internal_write_target_deploy_info function doesn't clear its result variable, which is why we had left-over elements in the targets variable. Some of these left-overs have a target type that's not compatible with TARGET_RUNTIME_DLLS, leading to the CMake error: Objects of target "lib1" referenced but is not one of the allowed target types (EXECUTABLE, SHARED, MODULE).". Fix this by clearing the targets variable initially. Fixes: QTBUG-119792 Change-Id: I921aa2f0af72638ed0ed7434450a43c66c1fc9f1 Reviewed-by: Alexey Edelev --- src/corelib/Qt6CoreMacros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 884f22aa8a..dbafe06dc5 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -2932,6 +2932,7 @@ endfunction() # Write deployment information for the targets of the project. function(_qt_internal_write_target_deploy_info out_file) + set(targets "") _qt_internal_collect_buildsystem_targets(targets "${CMAKE_SOURCE_DIR}" INCLUDE EXECUTABLE SHARED_LIBRARY MODULE_LIBRARY) set(content "")