diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-01-22 15:39:02 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2021-01-27 13:54:18 (GMT) |
commit | ef935b17ab47739b1e81e9c6baf6112b7a20f9cb (patch) | |
tree | 7f31fc4bcf6efb450e67b29ba6713937515ca956 /Source/cmLinkLineDeviceComputer.cxx | |
parent | 9ac8dbbb941194e79fd59acfc4affa018a222745 (diff) | |
download | CMake-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.cxx | 19 |
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( |