From 7d5e1c3b41b58e29d7dde7742582b3fa35a35e8e Mon Sep 17 00:00:00 2001
From: Patrick Gansterer <paroga@paroga.com>
Date: Sat, 26 Jan 2013 12:28:25 +0100
Subject: [PATCH] Ninja: Fix problems with EnableLanguage()

We need to call EnableLanguage() of the base class with all
languages at once, because general CMake files which require
defines not done by the first language won't appear.
---
 Source/cmGlobalNinjaGenerator.cxx | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 60f5a47..de13d13 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -502,12 +502,7 @@ void cmGlobalNinjaGenerator
     std::vector<std::string> language;
     language.push_back(*l);
 
-    if(*l == "NONE")
-      {
-      this->cmGlobalGenerator::EnableLanguage(language, mf, optional);
-      continue;
-      }
-    else if(*l == "Fortran")
+    if(*l == "Fortran")
       {
       std::string message = "The \"";
       message += this->GetName();
@@ -551,7 +546,16 @@ void cmGlobalNinjaGenerator
           }
         }
       }
-    this->cmGlobalGenerator::EnableLanguage(language, mf, optional);
+    }
+
+  this->cmGlobalGenerator::EnableLanguage(languages, mf, optional);
+  for(std::vector<std::string>::const_iterator l = languages.begin();
+      l != languages.end(); ++l)
+    {
+    if(*l == "NONE")
+      {
+      continue;
+      }
     this->ResolveLanguageCompiler(*l, mf, optional);
     }
 }
-- 
1.8.0.msysgit.0

