mirror of
https://github.com/reactos/CMake.git
synced 2025-02-10 05:42:45 +00:00
cmGlobalGenerator: Change case of methods from GeneratedMakeCommand struct
This commit is contained in:
parent
b3955a08ab
commit
fdeb364a84
@ -1780,7 +1780,7 @@ void cmGlobalGenerator::GenerateBuildCommand(
|
||||
bool /*unused*/, int /*unused*/, bool /*unused*/,
|
||||
std::vector<std::string> const& /*unused*/)
|
||||
{
|
||||
makeCommand.add("cmGlobalGenerator::GenerateBuildCommand not implemented");
|
||||
makeCommand.Add("cmGlobalGenerator::GenerateBuildCommand not implemented");
|
||||
}
|
||||
|
||||
void cmGlobalGenerator::PrintBuildCommandAdvice(std::ostream& /*os*/,
|
||||
@ -1841,7 +1841,7 @@ int cmGlobalGenerator::Build(int jobs, const std::string& /*unused*/,
|
||||
this->GenerateBuildCommand(cleanCommand, makeCommandCSTR, projectName,
|
||||
bindir, "clean", config, fast, jobs, verbose);
|
||||
output += "\nRun Clean Command:";
|
||||
output += cleanCommand.printable();
|
||||
output += cleanCommand.Printable();
|
||||
output += "\n";
|
||||
|
||||
if (!cmSystemTools::RunSingleCommand(cleanCommand.PrimaryCommand,
|
||||
@ -1858,7 +1858,7 @@ int cmGlobalGenerator::Build(int jobs, const std::string& /*unused*/,
|
||||
}
|
||||
|
||||
// now build
|
||||
std::string makeCommandStr = makeCommand.printable();
|
||||
std::string makeCommandStr = makeCommand.Printable();
|
||||
output += "\nRun Build Command(s):";
|
||||
output += makeCommandStr;
|
||||
output += "\n";
|
||||
|
@ -56,20 +56,20 @@ struct GeneratedMakeCommand
|
||||
{
|
||||
// Add each argument as a separate element to the vector
|
||||
template <typename... T>
|
||||
void add(T&&... args)
|
||||
void Add(T&&... args)
|
||||
{
|
||||
// iterate the args and append each one
|
||||
AppendStrs(PrimaryCommand, std::forward<T>(args)...);
|
||||
}
|
||||
|
||||
// Add each value in the iterators as a separate element to the vector
|
||||
void add(std::vector<std::string>::const_iterator start,
|
||||
void Add(std::vector<std::string>::const_iterator start,
|
||||
std::vector<std::string>::const_iterator end)
|
||||
{
|
||||
PrimaryCommand.insert(PrimaryCommand.end(), start, end);
|
||||
}
|
||||
|
||||
std::string printable() const
|
||||
std::string Printable() const
|
||||
{
|
||||
std::size_t size = PrimaryCommand.size();
|
||||
for (auto&& i : PrimaryCommand) {
|
||||
|
@ -377,16 +377,16 @@ void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
|
||||
{
|
||||
const char* gbuild =
|
||||
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
|
||||
makeCommand.add(this->SelectMakeProgram(makeProgram, (std::string)gbuild));
|
||||
makeCommand.Add(this->SelectMakeProgram(makeProgram, (std::string)gbuild));
|
||||
|
||||
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.add("-parallel");
|
||||
makeCommand.Add("-parallel");
|
||||
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.add(std::to_string(jobs));
|
||||
makeCommand.Add(std::to_string(jobs));
|
||||
}
|
||||
}
|
||||
|
||||
makeCommand.add(makeOptions.begin(), makeOptions.end());
|
||||
makeCommand.Add(makeOptions.begin(), makeOptions.end());
|
||||
|
||||
/* determine which top-project file to use */
|
||||
std::string proj = projectName + ".top" + FILE_EXTENSION;
|
||||
@ -399,15 +399,15 @@ void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
|
||||
}
|
||||
}
|
||||
|
||||
makeCommand.add("-top", proj);
|
||||
makeCommand.Add("-top", proj);
|
||||
if (!targetName.empty()) {
|
||||
if (targetName == "clean") {
|
||||
makeCommand.add("-clean");
|
||||
makeCommand.Add("-clean");
|
||||
} else {
|
||||
if (targetName.compare(targetName.size() - 4, 4, ".gpj") == 0) {
|
||||
makeCommand.add(targetName);
|
||||
makeCommand.Add(targetName);
|
||||
} else {
|
||||
makeCommand.add(targetName + ".gpj");
|
||||
makeCommand.Add(targetName + ".gpj");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -683,23 +683,23 @@ void cmGlobalNinjaGenerator::GenerateBuildCommand(
|
||||
const std::string& targetName, const std::string& /*config*/, bool /*fast*/,
|
||||
int jobs, bool verbose, std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
makeCommand.add(this->SelectMakeProgram(makeProgram));
|
||||
makeCommand.Add(this->SelectMakeProgram(makeProgram));
|
||||
|
||||
if (verbose) {
|
||||
makeCommand.add("-v");
|
||||
makeCommand.Add("-v");
|
||||
}
|
||||
|
||||
if ((jobs != cmake::NO_BUILD_PARALLEL_LEVEL) &&
|
||||
(jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL)) {
|
||||
makeCommand.add("-j", std::to_string(jobs));
|
||||
makeCommand.Add("-j", std::to_string(jobs));
|
||||
}
|
||||
|
||||
makeCommand.add(makeOptions.begin(), makeOptions.end());
|
||||
makeCommand.Add(makeOptions.begin(), makeOptions.end());
|
||||
if (!targetName.empty()) {
|
||||
if (targetName == "clean") {
|
||||
makeCommand.add("-t", "clean");
|
||||
makeCommand.Add("-t", "clean");
|
||||
} else {
|
||||
makeCommand.add(targetName);
|
||||
makeCommand.Add(targetName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -517,21 +517,21 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
|
||||
// Make it possible to set verbosity also from command line
|
||||
if (verbose) {
|
||||
makeCommand.add(cmSystemTools::GetCMakeCommand());
|
||||
makeCommand.add("-E");
|
||||
makeCommand.add("env");
|
||||
makeCommand.add("VERBOSE=1");
|
||||
makeCommand.Add(cmSystemTools::GetCMakeCommand());
|
||||
makeCommand.Add("-E");
|
||||
makeCommand.Add("env");
|
||||
makeCommand.Add("VERBOSE=1");
|
||||
}
|
||||
makeCommand.add(this->SelectMakeProgram(makeProgram));
|
||||
makeCommand.Add(this->SelectMakeProgram(makeProgram));
|
||||
|
||||
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.add("-j");
|
||||
makeCommand.Add("-j");
|
||||
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.add(std::to_string(jobs));
|
||||
makeCommand.Add(std::to_string(jobs));
|
||||
}
|
||||
}
|
||||
|
||||
makeCommand.add(makeOptions.begin(), makeOptions.end());
|
||||
makeCommand.Add(makeOptions.begin(), makeOptions.end());
|
||||
if (!targetName.empty()) {
|
||||
std::string tname = targetName;
|
||||
if (fast) {
|
||||
@ -541,7 +541,7 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
mf->GetStateSnapshot().GetDirectory().ConvertToRelPathIfNotContained(
|
||||
mf->GetState()->GetBinaryDirectory(), tname);
|
||||
cmSystemTools::ConvertToOutputSlashes(tname);
|
||||
makeCommand.add(std::move(tname));
|
||||
makeCommand.Add(std::move(tname));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -932,7 +932,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
||||
return;
|
||||
}
|
||||
|
||||
makeCommand.add(makeProgramSelected);
|
||||
makeCommand.Add(makeProgramSelected);
|
||||
|
||||
std::string realTarget = targetName;
|
||||
// msbuild.exe CxxOnly.sln /t:Build /p:Configuration=Debug /target:ALL_BUILD
|
||||
@ -941,8 +941,8 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
||||
realTarget = "ALL_BUILD";
|
||||
}
|
||||
if (realTarget == "clean") {
|
||||
makeCommand.add(std::string(projectName) + ".sln");
|
||||
makeCommand.add("/t:Clean");
|
||||
makeCommand.Add(std::string(projectName) + ".sln");
|
||||
makeCommand.Add("/t:Clean");
|
||||
} else {
|
||||
std::string targetProject(realTarget);
|
||||
targetProject += ".vcxproj";
|
||||
@ -954,7 +954,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
||||
cmSystemTools::ConvertToUnixSlashes(targetProject);
|
||||
}
|
||||
}
|
||||
makeCommand.add(std::move(targetProject));
|
||||
makeCommand.Add(std::move(targetProject));
|
||||
}
|
||||
std::string configArg = "/p:Configuration=";
|
||||
if (!config.empty()) {
|
||||
@ -962,26 +962,26 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
||||
} else {
|
||||
configArg += "Debug";
|
||||
}
|
||||
makeCommand.add(configArg);
|
||||
makeCommand.add(std::string("/p:Platform=") + this->GetPlatformName());
|
||||
makeCommand.add(std::string("/p:VisualStudioVersion=") +
|
||||
makeCommand.Add(configArg);
|
||||
makeCommand.Add(std::string("/p:Platform=") + this->GetPlatformName());
|
||||
makeCommand.Add(std::string("/p:VisualStudioVersion=") +
|
||||
this->GetIDEVersion());
|
||||
|
||||
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
|
||||
if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.add("/m");
|
||||
makeCommand.Add("/m");
|
||||
} else {
|
||||
makeCommand.add(std::string("/m:") + std::to_string(jobs));
|
||||
makeCommand.Add(std::string("/m:") + std::to_string(jobs));
|
||||
}
|
||||
// Having msbuild.exe and cl.exe using multiple jobs is discouraged
|
||||
makeCommand.add("/p:CL_MPCount=1");
|
||||
makeCommand.Add("/p:CL_MPCount=1");
|
||||
}
|
||||
|
||||
// Respect the verbosity: 'n' normal will show build commands
|
||||
// 'm' minimal only the build step's title
|
||||
makeCommand.add(std::string("/v:") + ((verbose) ? "n" : "m"));
|
||||
makeCommand.Add(std::string("/v:") + ((verbose) ? "n" : "m"));
|
||||
|
||||
makeCommand.add(makeOptions.begin(), makeOptions.end());
|
||||
makeCommand.Add(makeOptions.begin(), makeOptions.end());
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
|
||||
|
@ -213,9 +213,9 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
||||
makeCommand.RequiresOutputForward =
|
||||
(makeProgramLower.find("vcexpress") != std::string::npos);
|
||||
|
||||
makeCommand.add(makeProgramSelected);
|
||||
makeCommand.Add(makeProgramSelected);
|
||||
|
||||
makeCommand.add(std::string(projectName) + ".sln");
|
||||
makeCommand.Add(std::string(projectName) + ".sln");
|
||||
std::string realTarget = targetName;
|
||||
bool clean = false;
|
||||
if (realTarget == "clean") {
|
||||
@ -223,11 +223,11 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
||||
realTarget = "ALL_BUILD";
|
||||
}
|
||||
|
||||
makeCommand.add((clean ? "/clean" : "/build"));
|
||||
makeCommand.add((config.empty() ? "Debug" : config));
|
||||
makeCommand.add("/project");
|
||||
makeCommand.add((realTarget.empty() ? "ALL_BUILD" : realTarget));
|
||||
makeCommand.add(makeOptions.begin(), makeOptions.end());
|
||||
makeCommand.Add((clean ? "/clean" : "/build"));
|
||||
makeCommand.Add((config.empty() ? "Debug" : config));
|
||||
makeCommand.Add("/project");
|
||||
makeCommand.Add((realTarget.empty() ? "ALL_BUILD" : realTarget));
|
||||
makeCommand.Add(makeOptions.begin(), makeOptions.end());
|
||||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
|
@ -341,15 +341,15 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
|
||||
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
// now build the test
|
||||
makeCommand.add(
|
||||
makeCommand.Add(
|
||||
this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()));
|
||||
|
||||
if (!projectName.empty()) {
|
||||
makeCommand.add("-project");
|
||||
makeCommand.Add("-project");
|
||||
std::string projectArg = projectName;
|
||||
projectArg += ".xcode";
|
||||
projectArg += "proj";
|
||||
makeCommand.add(projectArg);
|
||||
makeCommand.Add(projectArg);
|
||||
}
|
||||
|
||||
bool clean = false;
|
||||
@ -359,21 +359,21 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
|
||||
realTarget = "ALL_BUILD";
|
||||
}
|
||||
|
||||
makeCommand.add((clean ? "clean" : "build"));
|
||||
makeCommand.add("-target", (realTarget.empty() ? "ALL_BUILD" : realTarget));
|
||||
makeCommand.add("-configuration", (config.empty() ? "Debug" : config));
|
||||
makeCommand.Add((clean ? "clean" : "build"));
|
||||
makeCommand.Add("-target", (realTarget.empty() ? "ALL_BUILD" : realTarget));
|
||||
makeCommand.Add("-configuration", (config.empty() ? "Debug" : config));
|
||||
|
||||
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.add("-jobs");
|
||||
makeCommand.Add("-jobs");
|
||||
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.add(std::to_string(jobs));
|
||||
makeCommand.Add(std::to_string(jobs));
|
||||
}
|
||||
}
|
||||
|
||||
if (this->XcodeVersion >= 70) {
|
||||
makeCommand.add("-hideShellScriptEnvironment");
|
||||
makeCommand.Add("-hideShellScriptEnvironment");
|
||||
}
|
||||
makeCommand.add(makeOptions.begin(), makeOptions.end());
|
||||
makeCommand.Add(makeOptions.begin(), makeOptions.end());
|
||||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
|
Loading…
x
Reference in New Issue
Block a user