summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorPeter Kümmel <syntheticpp@gmx.net>2012-07-15 14:03:22 (GMT)
committerPeter Kümmel <syntheticpp@gmx.net>2012-07-15 14:04:26 (GMT)
commit0c89c10cfcd9bdd11531e3680216235f5b34ac8e (patch)
tree9f4dac655fcfb264fe1cd3edaaf186b8edc9801d /Source/cmGlobalNinjaGenerator.cxx
parent46546809f5c7c5d0b96902f12f764eebf8cc1d48 (diff)
downloadCMake-0c89c10cfcd9bdd11531e3680216235f5b34ac8e.zip
CMake-0c89c10cfcd9bdd11531e3680216235f5b34ac8e.tar.gz
CMake-0c89c10cfcd9bdd11531e3680216235f5b34ac8e.tar.bz2
Ninja: search for windres with prefix
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 78208e3..3c97afc 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -474,9 +474,17 @@ void cmGlobalNinjaGenerator
if(mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
{
UsingMinGW = true;
- std::string rc = cmSystemTools::FindProgram("windres");
- if(!rc.empty())
- mf->AddDefinition("CMAKE_RC_COMPILER", rc.c_str());
+ if(!mf->GetDefinition("CMAKE_RC_COMPILER"))
+ {
+ std::string windres = "windres";
+ std::string gcc = mf->GetRequiredDefinition("CMAKE_C_COMPILER");
+ std::string::size_type prefix = gcc.rfind("gcc");
+ if (prefix != std::string::npos)
+ windres.insert(0, gcc.substr(0, prefix));
+ windres = cmSystemTools::FindProgram(windres.c_str());
+ if(!windres.empty())
+ mf->AddDefinition("CMAKE_RC_COMPILER", windres.c_str());
+ }
}
}
this->cmGlobalGenerator::EnableLanguage(language, mf, optional);