From 8c0d72e5bb16b90889712adcdbade75db4a88b57 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 19 Jul 2021 11:38:36 +0200 Subject: CMake: Fix Windows resource compiler failure in selftests with MinGW The MinGW resource compiler fails to handle compile definitions with multiple values. When the resource file is compiled as part of the main target rather than a separate object library, the resource generation rule will inherit all the compile definitions from the main target. For the case of tst_selftests this causes errors like gcc: error: badxml\: No such file or directory gcc: error: benchlibcallgrind\: No such file or directory gcc: error: benchlibcounting\: No such file or directory gcc: error: benchlibeventcounter\: No such file or directory gcc: error: benchliboptions\: No such file or directory Limit the compile definition to the C++ language only, so the multiple values are not passed to the resource compiler. Change-Id: Ie53666839272556323b50d79c090f0dc71745d11 Reviewed-by: Cristian Adam (cherry picked from commit 3a19c5b2e62b5c56fc0b4a424c1e62266493cf54) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/testlib/selftests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt index ec321dc282..3a2def6de2 100644 --- a/tests/auto/testlib/selftests/CMakeLists.txt +++ b/tests/auto/testlib/selftests/CMakeLists.txt @@ -133,7 +133,7 @@ endforeach() list(JOIN subprograms " " subprograms) qt_internal_extend_target(tst_selftests DEFINES - SUBPROGRAMS=${subprograms} + $<$:SUBPROGRAMS=${subprograms}> ) # special case end -- cgit v1.2.3