Ninja: there could be null pointers
This commit is contained in:
parent
0c89c10cfc
commit
78588e0343
|
@ -474,10 +474,11 @@ void cmGlobalNinjaGenerator
|
||||||
if(mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
|
if(mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
|
||||||
{
|
{
|
||||||
UsingMinGW = true;
|
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 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");
|
std::string::size_type prefix = gcc.rfind("gcc");
|
||||||
if (prefix != std::string::npos)
|
if (prefix != std::string::npos)
|
||||||
windres.insert(0, gcc.substr(0, prefix));
|
windres.insert(0, gcc.substr(0, prefix));
|
||||||
|
|
Loading…
Reference in New Issue