summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-02 21:27:31 (GMT)
committerBrad King <brad.king@kitware.com>2015-11-02 21:27:31 (GMT)
commited67f4052264003133b19edde2c85791d501e001 (patch)
tree3e868446dd23c143bc5936217726fb256632d2a9 /Source/cmGlobalNinjaGenerator.cxx
parent7748a02c3f7d028af13d4fc2c83e7181d11397e9 (diff)
downloadCMake-ed67f4052264003133b19edde2c85791d501e001.zip
CMake-ed67f4052264003133b19edde2c85791d501e001.tar.gz
CMake-ed67f4052264003133b19edde2c85791d501e001.tar.bz2
cmGlobalNinjaGenerator: Save path to 'ninja' tool very early
Keep it in a member variable for convenient reference. Set the value as soon as it is known.
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 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";
}