Early return if there is no target.
The remainder of this method depends on the target existing (otherwise the includes container would be empty), so make the code a little more readable.
This commit is contained in:
parent
eb250cd18a
commit
0ef091d986
|
@ -1390,6 +1390,11 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!target)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Load implicit include directories for this language.
|
// Load implicit include directories for this language.
|
||||||
std::string impDirVar = "CMAKE_";
|
std::string impDirVar = "CMAKE_";
|
||||||
impDirVar += lang;
|
impDirVar += lang;
|
||||||
|
@ -1407,10 +1412,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;
|
||||||
if(target)
|
|
||||||
{
|
includes = target->GetIncludeDirectories();
|
||||||
includes = target->GetIncludeDirectories();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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.
|
||||||
|
|
Loading…
Reference in New Issue