diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2018-07-25 10:18:49 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2018-07-25 10:24:16 (GMT) |
commit | db866d05deb1d345793aff4152211f7651451213 (patch) | |
tree | eb84c7faf9b817c2443f6b2b081f394565acf79c /Source/cmLocalGenerator.cxx | |
parent | 3713dc9b8e0662279e7f84133d5953998dcfe254 (diff) | |
download | CMake-db866d05deb1d345793aff4152211f7651451213.zip CMake-db866d05deb1d345793aff4152211f7651451213.tar.gz CMake-db866d05deb1d345793aff4152211f7651451213.tar.bz2 |
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.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0c50759..826ff84 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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,17 +941,21 @@ 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) { - cmSystemTools::ConvertToUnixSlashes(*i); - dirs.push_back(*i); + { + std::vector<std::string>::size_type const before = includes.size(); + { + 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) { |