summaryrefslogtreecommitdiff
path: root/Source/cmGlobalVisualStudio8Generator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-11-22 15:05:57 -0500
committerBen Boeckel <ben.boeckel@kitware.com>2022-11-29 12:39:45 -0500
commit707172c66ee385474027aae5e1327c76abd96ce8 (patch)
treed5fc6e2549df4eabb301f1b063521364aee96a8f /Source/cmGlobalVisualStudio8Generator.cxx
parent501408338aa403d9af50b2ba60f816cec5dcc06b (diff)
downloadcmake-707172c66ee385474027aae5e1327c76abd96ce8.tar.gz
clang-tidy: fix `readability-use-anyofallof` lints
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index c57649f4ba..89fa5c7e3f 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -405,20 +405,23 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
cmGeneratorTarget* target)
{
// Look for utility dependencies that magically link.
- for (BT<std::pair<std::string, bool>> const& ui : target->GetUtilities()) {
- if (cmGeneratorTarget* depTarget =
- target->GetLocalGenerator()->FindGeneratorTargetToUse(
- ui.Value.first)) {
- if (depTarget->IsInBuildSystem() &&
- depTarget->GetProperty("EXTERNAL_MSPROJECT")) {
- // This utility dependency names an external .vcproj target.
- // We use LinkLibraryDependencies="true" to link to it without
- // predicting the .lib file location or name.
- return true;
+ auto const& utilities = target->GetUtilities();
+ return std::any_of(
+ utilities.begin(), utilities.end(),
+ [target](BT<std::pair<std::string, bool>> const& ui) {
+ if (cmGeneratorTarget* depTarget =
+ target->GetLocalGenerator()->FindGeneratorTargetToUse(
+ ui.Value.first)) {
+ if (depTarget->IsInBuildSystem() &&
+ depTarget->GetProperty("EXTERNAL_MSPROJECT")) {
+ // This utility dependency names an external .vcproj target.
+ // We use LinkLibraryDependencies="true" to link to it without
+ // predicting the .lib file location or name.
+ return true;
+ }
}
- }
- }
- return false;
+ return false;
+ });
}
static cmVS7FlagTable cmVS8ExtraFlagTable[] = {