stringapi: Use strings for program paths
This commit is contained in:
parent
1a1b737c99
commit
6557382dcf
@ -107,7 +107,7 @@ bool cmBuildCommand
|
|||||||
|
|
||||||
std::string makecommand = this->Makefile->GetLocalGenerator()
|
std::string makecommand = this->Makefile->GetLocalGenerator()
|
||||||
->GetGlobalGenerator()->GenerateCMakeBuildCommand(target, configuration,
|
->GetGlobalGenerator()->GenerateCMakeBuildCommand(target, configuration,
|
||||||
0, true);
|
"", true);
|
||||||
|
|
||||||
this->Makefile->AddDefinition(variable, makecommand.c_str());
|
this->Makefile->AddDefinition(variable, makecommand.c_str());
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ bool cmBuildCommand
|
|||||||
|
|
||||||
std::string makecommand = this->Makefile->GetLocalGenerator()
|
std::string makecommand = this->Makefile->GetLocalGenerator()
|
||||||
->GetGlobalGenerator()->GenerateCMakeBuildCommand("", configType.c_str(),
|
->GetGlobalGenerator()->GenerateCMakeBuildCommand("", configType.c_str(),
|
||||||
0, true);
|
"", true);
|
||||||
|
|
||||||
if(cacheValue)
|
if(cacheValue)
|
||||||
{
|
{
|
||||||
|
@ -89,19 +89,25 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGlobalGenerator::SelectMakeProgram(const char* makeProgram,
|
std::string cmGlobalGenerator::SelectMakeProgram(
|
||||||
std::string makeDefault) const
|
const std::string& inMakeProgram,
|
||||||
|
const std::string& makeDefault) const
|
||||||
{
|
{
|
||||||
if(cmSystemTools::IsOff(makeProgram))
|
std::string makeProgram = inMakeProgram;
|
||||||
|
if(cmSystemTools::IsOff(makeProgram.c_str()))
|
||||||
{
|
{
|
||||||
makeProgram =
|
const char* makeProgramCSTR =
|
||||||
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
|
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
|
||||||
if(cmSystemTools::IsOff(makeProgram))
|
if(cmSystemTools::IsOff(makeProgramCSTR))
|
||||||
{
|
{
|
||||||
makeProgram = makeDefault.c_str();
|
makeProgram = makeDefault;
|
||||||
}
|
}
|
||||||
if(cmSystemTools::IsOff(makeProgram) &&
|
else
|
||||||
!(makeProgram && *makeProgram))
|
{
|
||||||
|
makeProgram = makeProgramCSTR;
|
||||||
|
}
|
||||||
|
if(cmSystemTools::IsOff(makeProgram.c_str()) &&
|
||||||
|
!makeProgram.empty())
|
||||||
{
|
{
|
||||||
makeProgram = "CMAKE_MAKE_PROGRAM-NOTFOUND";
|
makeProgram = "CMAKE_MAKE_PROGRAM-NOTFOUND";
|
||||||
}
|
}
|
||||||
@ -1660,13 +1666,14 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir,
|
|||||||
mf->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
mf->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
||||||
return this->Build(srcdir,bindir,projectName,
|
return this->Build(srcdir,bindir,projectName,
|
||||||
newTarget.c_str(),
|
newTarget.c_str(),
|
||||||
output,0,config,false,fast,
|
output,"",config,false,fast,
|
||||||
this->TryCompileTimeout);
|
this->TryCompileTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGlobalGenerator::GenerateBuildCommand(
|
void cmGlobalGenerator::GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand, const char*, const std::string&,
|
std::vector<std::string>& makeCommand, const std::string&,
|
||||||
const std::string&, const std::string&, const std::string&, bool,
|
const std::string&, const std::string&, const std::string&,
|
||||||
|
const std::string&, bool,
|
||||||
std::vector<std::string> const&)
|
std::vector<std::string> const&)
|
||||||
{
|
{
|
||||||
makeCommand.push_back(
|
makeCommand.push_back(
|
||||||
@ -1677,7 +1684,7 @@ int cmGlobalGenerator::Build(
|
|||||||
const std::string&, const std::string& bindir,
|
const std::string&, const std::string& bindir,
|
||||||
const std::string& projectName, const std::string& target,
|
const std::string& projectName, const std::string& target,
|
||||||
std::string *output,
|
std::string *output,
|
||||||
const char *makeCommandCSTR,
|
const std::string& makeCommandCSTR,
|
||||||
const std::string& config,
|
const std::string& config,
|
||||||
bool clean, bool fast,
|
bool clean, bool fast,
|
||||||
double timeout,
|
double timeout,
|
||||||
|
@ -120,7 +120,7 @@ public:
|
|||||||
int Build(const std::string& srcdir, const std::string& bindir,
|
int Build(const std::string& srcdir, const std::string& bindir,
|
||||||
const std::string& projectName, const std::string& targetName,
|
const std::string& projectName, const std::string& targetName,
|
||||||
std::string *output,
|
std::string *output,
|
||||||
const char *makeProgram, const std::string& config,
|
const std::string& makeProgram, const std::string& config,
|
||||||
bool clean, bool fast,
|
bool clean, bool fast,
|
||||||
double timeout,
|
double timeout,
|
||||||
cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE,
|
cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE,
|
||||||
@ -129,7 +129,7 @@ public:
|
|||||||
|
|
||||||
virtual void GenerateBuildCommand(
|
virtual void GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName, const std::string& projectDir,
|
const std::string& projectName, const std::string& projectDir,
|
||||||
const std::string& targetName, const std::string& config, bool fast,
|
const std::string& targetName, const std::string& config, bool fast,
|
||||||
std::vector<std::string> const& makeOptions = std::vector<std::string>()
|
std::vector<std::string> const& makeOptions = std::vector<std::string>()
|
||||||
@ -345,8 +345,8 @@ protected:
|
|||||||
cmTarget const*> > AutogensType;
|
cmTarget const*> > AutogensType;
|
||||||
void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
|
void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
|
||||||
|
|
||||||
std::string SelectMakeProgram(const char* makeProgram,
|
std::string SelectMakeProgram(const std::string& makeProgram,
|
||||||
std::string makeDefault = "") const;
|
const std::string& makeDefault = "") const;
|
||||||
|
|
||||||
// Fill the ProjectMap, this must be called after LocalGenerators
|
// Fill the ProjectMap, this must be called after LocalGenerators
|
||||||
// has been populated.
|
// has been populated.
|
||||||
|
@ -551,7 +551,7 @@ bool cmGlobalNinjaGenerator::UsingMinGW = false;
|
|||||||
// cmGlobalGenerator::Build()
|
// cmGlobalGenerator::Build()
|
||||||
void cmGlobalNinjaGenerator
|
void cmGlobalNinjaGenerator
|
||||||
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
|
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& /*projectName*/,
|
const std::string& /*projectName*/,
|
||||||
const std::string& /*projectDir*/,
|
const std::string& /*projectDir*/,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -193,7 +193,7 @@ public:
|
|||||||
/// Overloaded methods. @see cmGlobalGenerator::GenerateBuildCommand()
|
/// Overloaded methods. @see cmGlobalGenerator::GenerateBuildCommand()
|
||||||
virtual void GenerateBuildCommand(
|
virtual void GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& projectDir,
|
const std::string& projectDir,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -565,7 +565,7 @@ cmGlobalUnixMakefileGenerator3
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalUnixMakefileGenerator3
|
void cmGlobalUnixMakefileGenerator3
|
||||||
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
|
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& /*projectName*/,
|
const std::string& /*projectName*/,
|
||||||
const std::string& /*projectDir*/,
|
const std::string& /*projectDir*/,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -109,7 +109,7 @@ public:
|
|||||||
// change the build command for speed
|
// change the build command for speed
|
||||||
virtual void GenerateBuildCommand(
|
virtual void GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& projectDir,
|
const std::string& projectDir,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -312,7 +312,7 @@ std::string cmGlobalVisualStudio10Generator::FindDevEnvCommand()
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& projectDir,
|
const std::string& projectDir,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
|
|
||||||
virtual void GenerateBuildCommand(
|
virtual void GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& projectDir,
|
const std::string& projectDir,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -116,7 +116,7 @@ std::string cmGlobalVisualStudio6Generator::FindMSDevCommand()
|
|||||||
void
|
void
|
||||||
cmGlobalVisualStudio6Generator::GenerateBuildCommand(
|
cmGlobalVisualStudio6Generator::GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& /*projectDir*/,
|
const std::string& /*projectDir*/,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -54,7 +54,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void GenerateBuildCommand(
|
virtual void GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& projectDir,
|
const std::string& projectDir,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -186,7 +186,7 @@ const char* cmGlobalVisualStudio7Generator::ExternalProjectType(
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& /*projectDir*/,
|
const std::string& /*projectDir*/,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void GenerateBuildCommand(
|
virtual void GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& projectDir,
|
const std::string& projectDir,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -261,7 +261,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
|
|||||||
void
|
void
|
||||||
cmGlobalXCodeGenerator::GenerateBuildCommand(
|
cmGlobalXCodeGenerator::GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& /*projectDir*/,
|
const std::string& /*projectDir*/,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -55,7 +55,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void GenerateBuildCommand(
|
virtual void GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
const char* makeProgram,
|
const std::string& makeProgram,
|
||||||
const std::string& projectName,
|
const std::string& projectName,
|
||||||
const std::string& projectDir,
|
const std::string& projectDir,
|
||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
|
@ -2672,7 +2672,7 @@ int cmake::Build(const std::string& dir,
|
|||||||
return gen->Build("", dir.c_str(),
|
return gen->Build("", dir.c_str(),
|
||||||
projName.c_str(), target.c_str(),
|
projName.c_str(), target.c_str(),
|
||||||
&output,
|
&output,
|
||||||
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