diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-19 11:38:36 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-22 15:56:37 +0200 |
commit | 3a19c5b2e62b5c56fc0b4a424c1e62266493cf54 (patch) | |
tree | 2c10ad037813898e72ba5fb486a77435b353be71 | |
parent | 21782bdc048a76a8b3f85f7633741f565312f1b6 (diff) |
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.
Pick-to: 6.2
Change-Id: Ie53666839272556323b50d79c090f0dc71745d11
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
-rw-r--r-- | tests/auto/testlib/selftests/CMakeLists.txt | 2 |
1 files changed, 1 insertions, 1 deletions
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} + $<$<COMPILE_LANGUAGE:CXX>:SUBPROGRAMS=${subprograms}> ) # special case end |