mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
Cleanup: Fix warning about binding to a temporary in range-based for
This commit is contained in:
@@ -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() &&
|
||||
|
||||
Reference in New Issue
Block a user