mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-04 04:03:22 +03:00
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.
This commit is contained in:
1 parent
d1077c1ce6
commit
3713dc9b8e
1 file changed
+24
-21
+24
-21
@@ -879,28 +879,31 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
|
||||
return;
|
||||
}
|
||||
|
||||
std::string rootPath;
|
||||
if (const char* sysrootCompile =
|
||||
this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) {
|
||||
rootPath = sysrootCompile;
|
||||
} else {
|
||||
rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
|
||||
}
|
||||
|
||||
// Implicit include directories
|
||||
std::vector<std::string> implicitDirs;
|
||||
// Load implicit include directories for this language.
|
||||
std::string impDirVar = "CMAKE_";
|
||||
impDirVar += lang;
|
||||
impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
|
||||
if (const char* value = this->Makefile->GetDefinition(impDirVar)) {
|
||||
std::vector<std::string> impDirVec;
|
||||
cmSystemTools::ExpandListArgument(value, impDirVec);
|
||||
for (std::string const& i : impDirVec) {
|
||||
std::string d = rootPath + i;
|
||||
cmSystemTools::ConvertToUnixSlashes(d);
|
||||
emitted.insert(std::move(d));
|
||||
if (!stripImplicitInclDirs) {
|
||||
implicitDirs.push_back(i);
|
||||
{
|
||||
std::string rootPath;
|
||||
if (const char* sysrootCompile =
|
||||
this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) {
|
||||
rootPath = sysrootCompile;
|
||||
} else {
|
||||
rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
|
||||
}
|
||||
|
||||
// Load implicit include directories for this language.
|
||||
std::string key = "CMAKE_";
|
||||
key += lang;
|
||||
key += "_IMPLICIT_INCLUDE_DIRECTORIES";
|
||||
if (const char* value = this->Makefile->GetDefinition(key)) {
|
||||
std::vector<std::string> impDirVec;
|
||||
cmSystemTools::ExpandListArgument(value, impDirVec);
|
||||
for (std::string const& i : impDirVec) {
|
||||
std::string d = rootPath + i;
|
||||
cmSystemTools::ConvertToUnixSlashes(d);
|
||||
emitted.insert(std::move(d));
|
||||
if (!stripImplicitInclDirs) {
|
||||
implicitDirs.push_back(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user