Commit db866d05 authored by Sebastian Holtermann's avatar Sebastian Holtermann
Browse files

cmLocalGenerator: Style change: Wrap temporary strings and code in braces

Code style change in ``cmLocalGenerator::GetIncludeDirectories``.

Embrace ``{}`` temporary strings and code that uses them to minimize their
lifetime.
parent 3713dc9b
......@@ -909,9 +909,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
// Get the target-specific include directories.
std::vector<std::string> includes;
includes = target->GetIncludeDirectories(config, lang);
std::vector<std::string> includes =
target->GetIncludeDirectories(config, lang);
// Support putting all the in-project include directories first if
// it is requested by the project.
......@@ -942,18 +941,22 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
this->MoveSystemIncludesToEnd(dirs, config, lang, target);
// Add standard include directories for this language.
// We do not filter out implicit directories here.
std::string const standardIncludesVar =
"CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES";
std::string const standardIncludes =
this->Makefile->GetSafeDefinition(standardIncludesVar);
{
std::vector<std::string>::size_type const before = includes.size();
cmSystemTools::ExpandListArgument(standardIncludes, includes);
for (std::vector<std::string>::iterator i = includes.begin() + before;
i != includes.end(); ++i) {
{
std::string key = "CMAKE_";
key += lang;
key += "_STANDARD_INCLUDE_DIRECTORIES";
std::string const value = this->Makefile->GetSafeDefinition(key);
cmSystemTools::ExpandListArgument(value, includes);
}
for (std::vector<std::string>::iterator i = includes.begin() + before,
ie = includes.end();
i != ie; ++i) {
cmSystemTools::ConvertToUnixSlashes(*i);
dirs.push_back(*i);
}
}
for (std::string const& i : implicitDirs) {
if (std::find(includes.begin(), includes.end(), i) != includes.end()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment