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()