diff options
author | Peter Kuemmel <syntheticpp@gmx.net> | 2012-06-06 11:02:30 (GMT) |
---|---|---|
committer | Peter Kuemmel <syntheticpp@gmx.net> | 2012-06-06 11:02:30 (GMT) |
commit | e3a1f727f75e6077e7724719c606d833e8bbd9b0 (patch) | |
tree | dcef157d59633b968b2b949e58deb9299127de8c /Source/cmGlobalNinjaGenerator.cxx | |
parent | c60557e973643c5d60da17911d096f7ac88996c2 (diff) | |
download | CMake-e3a1f727f75e6077e7724719c606d833e8bbd9b0.zip CMake-e3a1f727f75e6077e7724719c606d833e8bbd9b0.tar.gz CMake-e3a1f727f75e6077e7724719c606d833e8bbd9b0.tar.bz2 |
Ninja: find mingw's resource compiler
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 5477adf..c4b1cc9 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -434,16 +434,19 @@ void cmGlobalNinjaGenerator cmMakefile *mf, bool optional) { - this->cmGlobalGenerator::EnableLanguage(languages, mf, optional); std::string path; for(std::vector<std::string>::const_iterator l = languages.begin(); l != languages.end(); ++l) { + std::vector<std::string> language; + language.push_back(*l); + if(*l == "NONE") { + this->cmGlobalGenerator::EnableLanguage(language, mf, optional); continue; } - if(*l == "Fortran") + else if(*l == "Fortran") { std::string message = "The \""; message += this->GetName(); @@ -452,15 +455,22 @@ void cmGlobalNinjaGenerator message += "\" yet."; cmSystemTools::Error(message.c_str()); } + else if(*l == "RC") + { + // check if mingw is used + const char* cc = mf->GetDefinition("CMAKE_C_COMPILER"); + if(cc && std::string(cc).find("gcc.exe") != std::string::npos) + { + UsingMinGW = true; + std::string rc = cmSystemTools::FindProgram("windres"); + if(rc.empty()) + rc = "windres.exe";; + mf->AddDefinition("CMAKE_RC_COMPILER", rc.c_str()); + } + } + this->cmGlobalGenerator::EnableLanguage(language, mf, optional); this->ResolveLanguageCompiler(*l, mf, optional); - } - - // check for mingw - const char* cc = mf->GetDefinition("CMAKE_C_COMPILER"); - if(cc && std::string(cc).find("gcc.exe") != std::string::npos) - { - UsingMinGW = true; - } + } } bool cmGlobalNinjaGenerator::UsingMinGW = false; |