From a1ccedeb440216dce87fad01746935a89fd8715e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 11 May 2020 14:51:33 +0200 Subject: [PATCH] CMake: Workaround fix for failing RC file generation on Windows For some reason the Help target doesn't get its RC file generated when building qttools, which leads to a build failure. We don't quite know yet why all this is happening, but a workaround fix seems to be to use an OBJECT library instead of an INTERFACE library to propagate the generated RC file. Amends 657fa0462d552110e2ba14bcac46275e6066993f Fixes: QTBUG-84155 Change-Id: I1e1c2f3b05bae2ed009020d031c6510a517c01ec Reviewed-by: Joerg Bornemann --- src/corelib/Qt6CoreMacros.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 9dade2edbd0..e5c40e92437 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -969,8 +969,7 @@ END # We would like to do the following: # target_sources(${target} PRIVATE "$<$:${output}>") # However, https://gitlab.kitware.com/cmake/cmake/-/issues/20682 doesn't let us. - add_library(${target}_${cfg}_rc INTERFACE) - target_sources(${target}_${cfg}_rc INTERFACE "${output}") + add_library(${target}_${cfg}_rc OBJECT "${output}") target_link_libraries(${target} PRIVATE "$<$:${target}_${cfg}_rc>") endwhile() endif()