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.
This commit is contained in:
parent
7748a02c3f
commit
ed67f40522
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue