summaryrefslogtreecommitdiffstats
path: root/Source/cmLinkLineDeviceComputer.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2021-01-22 15:39:02 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2021-01-27 13:54:18 (GMT)
commitef935b17ab47739b1e81e9c6baf6112b7a20f9cb (patch)
tree7f31fc4bcf6efb450e67b29ba6713937515ca956 /Source/cmLinkLineDeviceComputer.cxx
parent9ac8dbbb941194e79fd59acfc4affa018a222745 (diff)
downloadCMake-ef935b17ab47739b1e81e9c6baf6112b7a20f9cb.zip
CMake-ef935b17ab47739b1e81e9c6baf6112b7a20f9cb.tar.gz
CMake-ef935b17ab47739b1e81e9c6baf6112b7a20f9cb.tar.bz2
clang-tidy: fix `readability-use-anyofallof` warnings
Diffstat (limited to 'Source/cmLinkLineDeviceComputer.cxx')
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index 5739fec..9cae926 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -3,6 +3,7 @@
#include "cmLinkLineDeviceComputer.h"
+#include <algorithm>
#include <set>
#include <utility>
@@ -57,17 +58,15 @@ bool cmLinkLineDeviceComputer::ComputeRequiresDeviceLinking(
using ItemVector = cmComputeLinkInformation::ItemVector;
ItemVector const& items = cli.GetItems();
std::string config = cli.GetConfig();
- for (auto const& item : items) {
- if (item.Target &&
- item.Target->GetType() == cmStateEnums::STATIC_LIBRARY) {
- if ((!item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS")) &&
- item.Target->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) {
+ return std::any_of(
+ items.begin(), items.end(),
+ [](cmComputeLinkInformation::Item const& item) -> bool {
+ return item.Target &&
+ item.Target->GetType() == cmStateEnums::STATIC_LIBRARY &&
// this dependency requires us to device link it
- return true;
- }
- }
- }
- return false;
+ !item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS") &&
+ item.Target->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION");
+ });
}
void cmLinkLineDeviceComputer::ComputeLinkLibraries(