diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 4 |
2 files changed, 14 insertions, 4 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 8498e39..6e7c43a 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -585,6 +585,15 @@ void cmGlobalNinjaGenerator::Generate() this->CloseBuildFileStream(); } +void cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf) +{ + this->cmGlobalGenerator::FindMakeProgram(mf); + if (const char* ninjaCommand = mf->GetDefinition("CMAKE_MAKE_PROGRAM")) + { + this->NinjaCommand = ninjaCommand; + } +} + void cmGlobalNinjaGenerator ::EnableLanguage(std::vector<std::string>const& langs, cmMakefile* mf, @@ -1260,9 +1269,8 @@ std::string cmGlobalNinjaGenerator::ninjaCmd() const { cmLocalGenerator* lgen = this->LocalGenerators[0]; if (lgen) { - return lgen->ConvertToOutputFormat( - lgen->GetMakefile()->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"), - cmLocalGenerator::SHELL); + return lgen->ConvertToOutputFormat(this->NinjaCommand, + cmLocalGenerator::SHELL); } return "ninja"; } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 7547f16..f228340 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -320,7 +320,7 @@ protected: private: virtual std::string GetEditCacheCommand() const; - + virtual void FindMakeProgram(cmMakefile* mf); void OpenBuildFileStream(); void CloseBuildFileStream(); @@ -392,6 +392,8 @@ private: typedef std::map<std::string, cmGeneratorTarget*> TargetAliasMap; TargetAliasMap TargetAliases; + + std::string NinjaCommand; }; #endif // ! cmGlobalNinjaGenerator_h |