summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraEclipseCDT4Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-23 13:34:38 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-23 13:43:46 (GMT)
commitc491cb1eb4030d70e7a04bcda5021ebd0e5ca88d (patch)
tree93bd894a37259b7ca1c81cc3bff7e004a90265ad /Source/cmExtraEclipseCDT4Generator.cxx
parent562d5f576ab31771d2e02258eaad8afdf4d12f00 (diff)
downloadCMake-c491cb1eb4030d70e7a04bcda5021ebd0e5ca88d.zip
CMake-c491cb1eb4030d70e7a04bcda5021ebd0e5ca88d.tar.gz
CMake-c491cb1eb4030d70e7a04bcda5021ebd0e5ca88d.tar.bz2
Fix some generator crashes on undefined CMAKE_BUILD_TYPE
Since commit 84fdc9921 (stringapi: Pass configuration names as strings, 2014-02-09), it is not safe to use GetDefinition("CMAKE_BUILD_TYPE") without checking the return value. Use GetSafeDefinition instead so that a missing definition is treated as an empty string like code paths did prior to the above commit. Reported-by: Richard Wirth <richard@califax.de>
Diffstat (limited to 'Source/cmExtraEclipseCDT4Generator.cxx')
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index e23551e..1beb3fd 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -968,7 +968,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
continue;
}
std::vector<std::string> includeDirs;
- const char *config = mf->GetDefinition("CMAKE_BUILD_TYPE");
+ std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE");
(*it)->GetIncludeDirectories(includeDirs, l->second, "C", config);
this->AppendIncludeDirectories(fout, includeDirs, emmited);
}