summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-08-19 21:14:15 (GMT)
committerBrad King <brad.king@kitware.com>2012-09-28 12:49:21 (GMT)
commit0ef091d98677253c340d4045413057c50566a528 (patch)
tree8ead48d908b7b6450ebb34e953d6dcf250812d4c /Source/cmLocalGenerator.cxx
parenteb250cd18aaa5308eee12cf016bbfdd25a543da6 (diff)
downloadCMake-0ef091d98677253c340d4045413057c50566a528.zip
CMake-0ef091d98677253c340d4045413057c50566a528.tar.gz
CMake-0ef091d98677253c340d4045413057c50566a528.tar.bz2
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.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 62b6ce7..3f6fe03 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1390,6 +1390,11 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
}
+ if(!target)
+ {
+ return;
+ }
+
// Load implicit include directories for this language.
std::string impDirVar = "CMAKE_";
impDirVar += lang;
@@ -1407,10 +1412,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
// Get the target-specific include directories.
std::vector<std::string> includes;
- if(target)
- {
- includes = target->GetIncludeDirectories();
- }
+
+ includes = target->GetIncludeDirectories();
// Support putting all the in-project include directories first if
// it is requested by the project.