diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-19 11:38:36 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-22 14:09:49 +0000 |
commit | 8c0d72e5bb16b90889712adcdbade75db4a88b57 (patch) | |
tree | 313cf38a995e9d5f642a21aecfc3ee5c45d9d828 | |
parent | 2da43e2e5462d452292050e4461cb5ef6305c7c8 (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.
Change-Id: Ie53666839272556323b50d79c090f0dc71745d11
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 3a19c5b2e62b5c56fc0b4a424c1e62266493cf54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 |