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 <joerg.bornemann@qt.io>
This commit is contained in:
Alexandru Croitor 2020-05-11 14:51:33 +02:00
parent b56ed4da74
commit a1ccedeb44

View File

@ -969,8 +969,7 @@ END
# We would like to do the following:
# target_sources(${target} PRIVATE "$<$<CONFIG:${cfg}>:${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 "$<$<CONFIG:${cfg}>:${target}_${cfg}_rc>")
endwhile()
endif()