Ninja: there could be null pointers

This commit is contained in:
Peter Kümmel 2012-07-15 18:48:31 +02:00
parent 0c89c10cfc
commit 78588e0343
1 changed files with 3 additions and 2 deletions

View File

@ -474,10 +474,11 @@ void cmGlobalNinjaGenerator
if(mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
{
UsingMinGW = true;
if(!mf->GetDefinition("CMAKE_RC_COMPILER"))
if(!mf->GetDefinition("CMAKE_RC_COMPILER")
&& mf->GetDefinition("CMAKE_C_COMPILER"))
{
std::string windres = "windres";
std::string gcc = mf->GetRequiredDefinition("CMAKE_C_COMPILER");
std::string gcc = mf->GetDefinition("CMAKE_C_COMPILER");
std::string::size_type prefix = gcc.rfind("gcc");
if (prefix != std::string::npos)
windres.insert(0, gcc.substr(0, prefix));