mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-26 18:58:34 -06:00
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>
This commit is contained in:
@@ -574,7 +574,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
||||
}
|
||||
}
|
||||
|
||||
const char* buildType = makefile->GetDefinition("CMAKE_BUILD_TYPE");
|
||||
std::string buildType = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
||||
std::string location;
|
||||
if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user