summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-14 13:18:01 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-15 09:39:25 (GMT)
commit25995b2b3028a5f990792b6e2e409f681c3a89d0 (patch)
treee52d07357e8b7a57cf2d53d78491a98a0a7ee8f8 /Source
parentae9614a22d5e39882b2a686e8229170a8296212d (diff)
downloadCMake-25995b2b3028a5f990792b6e2e409f681c3a89d0.zip
CMake-25995b2b3028a5f990792b6e2e409f681c3a89d0.tar.gz
CMake-25995b2b3028a5f990792b6e2e409f681c3a89d0.tar.bz2
cmGlobalGenerator: Fix CheckTargetsForMissingSources after refactoring
Refactoring in commit 01b2d6ab74 (Modernize: Use ranged for-loops when possible, 2019-02-07, v3.15.0-rc1~575^2) accidentally changed a loop condition in this method from "keep iterating if srcs.empty()" to "stop iterating if srcs.empty()". Switch it back. The bug could only manifest in very subtle conditions in a multi-config generator. Add one such case to the test suite. Fixes: #20706
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6370ed2..cfad4c2 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -320,7 +320,7 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
} else {
for (std::string const& config : configs) {
target->GetSourceFiles(srcs, config);
- if (srcs.empty()) {
+ if (!srcs.empty()) {
break;
}
}