Simplify some calls to cmGlobalGenerator::Build
Code paths that look up CMAKE_MAKE_PROGRAM from the cache only to pass it to Build, which only passes it to GenerateBuildCommand, no longer need to do so. GenerateBuildCommand now knows how to look up CMAKE_MAKE_PROGRAM in the cache when no explicit value is given, so simply pass 0 now.
This commit is contained in:
parent
123a0608df
commit
91a021146c
@ -1562,15 +1562,6 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
|
|||||||
this->FirstTimeProgress);
|
this->FirstTimeProgress);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string makeCommand = this->CMakeInstance->
|
|
||||||
GetCacheManager()->GetCacheValue("CMAKE_MAKE_PROGRAM");
|
|
||||||
if(makeCommand.size() == 0)
|
|
||||||
{
|
|
||||||
cmSystemTools::Error(
|
|
||||||
"Generator cannot find the appropriate make command.");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string newTarget;
|
std::string newTarget;
|
||||||
if (target && strlen(target))
|
if (target && strlen(target))
|
||||||
{
|
{
|
||||||
@ -1590,7 +1581,7 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
|
|||||||
const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
||||||
return this->Build(srcdir,bindir,projectName,
|
return this->Build(srcdir,bindir,projectName,
|
||||||
newTarget.c_str(),
|
newTarget.c_str(),
|
||||||
output,makeCommand.c_str(),config,false,fast,
|
output,0,config,false,fast,
|
||||||
this->TryCompileTimeout);
|
this->TryCompileTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2663,23 +2663,16 @@ int cmake::Build(const std::string& dir,
|
|||||||
this->CreateGlobalGenerator(it.GetValue()));
|
this->CreateGlobalGenerator(it.GetValue()));
|
||||||
std::string output;
|
std::string output;
|
||||||
std::string projName;
|
std::string projName;
|
||||||
std::string makeProgram;
|
|
||||||
if(!it.Find("CMAKE_PROJECT_NAME"))
|
if(!it.Find("CMAKE_PROJECT_NAME"))
|
||||||
{
|
{
|
||||||
std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n";
|
std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
projName = it.GetValue();
|
projName = it.GetValue();
|
||||||
if(!it.Find("CMAKE_MAKE_PROGRAM"))
|
|
||||||
{
|
|
||||||
std::cerr << "Error: could not find CMAKE_MAKE_PROGRAM in Cache\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
makeProgram = it.GetValue();
|
|
||||||
return gen->Build(0, dir.c_str(),
|
return gen->Build(0, dir.c_str(),
|
||||||
projName.c_str(), target.c_str(),
|
projName.c_str(), target.c_str(),
|
||||||
&output,
|
&output,
|
||||||
makeProgram.c_str(),
|
0,
|
||||||
config.c_str(), clean, false, 0,
|
config.c_str(), clean, false, 0,
|
||||||
cmSystemTools::OUTPUT_PASSTHROUGH,
|
cmSystemTools::OUTPUT_PASSTHROUGH,
|
||||||
nativeOptions);
|
nativeOptions);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user