diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-12-06 07:46:00 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2020-12-07 21:32:30 (GMT) |
commit | 99a26babb1dc42a83a73869883684b76a538047c (patch) | |
tree | 1a1a61c025b46388c60d1b9fe3715d81a7dba3d5 /Source/cmLocalGenerator.cxx | |
parent | 14576a40accb93f0f0a7f06b00996edf17ba4aa2 (diff) | |
download | CMake-99a26babb1dc42a83a73869883684b76a538047c.zip CMake-99a26babb1dc42a83a73869883684b76a538047c.tar.gz CMake-99a26babb1dc42a83a73869883684b76a538047c.tar.bz2 |
Cleanup: Fix warning about binding to a temporary in range-based for
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index f582701..5f67e27 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -3,6 +3,7 @@ #include "cmLocalGenerator.h" #include <algorithm> +#include <array> #include <cassert> #include <cstdio> #include <cstdlib> @@ -2474,8 +2475,10 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) target->GetSourceFiles(sources, config); const std::string configUpper = cmSystemTools::UpperCase(config); + static const std::array<std::string, 4> langs = { { "C", "CXX", "OBJC", + "OBJCXX" } }; - for (const std::string& lang : { "C", "CXX", "OBJC", "OBJCXX" }) { + for (const std::string& lang : langs) { auto langSources = std::count_if( sources.begin(), sources.end(), [lang](cmSourceFile* sf) { return lang == sf->GetLanguage() && |