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, ...@@ -909,9 +909,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
} }
// Get the target-specific include directories. // Get the target-specific include directories.
std::vector<std::string> includes; std::vector<std::string> includes =
target->GetIncludeDirectories(config, lang);
includes = target->GetIncludeDirectories(config, lang);
// Support putting all the in-project include directories first if // Support putting all the in-project include directories first if
// it is requested by the project. // it is requested by the project.
...@@ -942,17 +941,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, ...@@ -942,17 +941,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
this->MoveSystemIncludesToEnd(dirs, config, lang, target); this->MoveSystemIncludesToEnd(dirs, config, lang, target);
// Add standard include directories for this language. // Add standard include directories for this language.
// We do not filter out implicit directories here. {
std::string const standardIncludesVar = std::vector<std::string>::size_type const before = includes.size();
"CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES"; {
std::string const standardIncludes = std::string key = "CMAKE_";
this->Makefile->GetSafeDefinition(standardIncludesVar); key += lang;
std::vector<std::string>::size_type const before = includes.size(); key += "_STANDARD_INCLUDE_DIRECTORIES";
cmSystemTools::ExpandListArgument(standardIncludes, includes); std::string const value = this->Makefile->GetSafeDefinition(key);
for (std::vector<std::string>::iterator i = includes.begin() + before; cmSystemTools::ExpandListArgument(value, includes);
i != includes.end(); ++i) { }
cmSystemTools::ConvertToUnixSlashes(*i); for (std::vector<std::string>::iterator i = includes.begin() + before,
dirs.push_back(*i); ie = includes.end();
i != ie; ++i) {
cmSystemTools::ConvertToUnixSlashes(*i);
dirs.push_back(*i);
}
} }
for (std::string const& i : implicitDirs) { for (std::string const& i : implicitDirs) {
......
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