build_command: Add the PARALLEL_LEVEL argument

Issue: #19712
This commit is contained in:
friendlyanon
2021-05-01 16:10:21 +02:00
parent 4dd4e9dd6c
commit fc2ac46043
5 changed files with 31 additions and 7 deletions
+9 -2
View File
@@ -28,12 +28,14 @@ bool MainSignature(std::vector<std::string> const& args,
std::string configuration;
std::string project_name;
std::string target;
std::string parallel;
enum Doing
{
DoingNone,
DoingConfiguration,
DoingProjectName,
DoingTarget
DoingTarget,
DoingParallel
};
Doing doing = DoingNone;
for (unsigned int i = 1; i < args.size(); ++i) {
@@ -43,6 +45,8 @@ bool MainSignature(std::vector<std::string> const& args,
doing = DoingProjectName;
} else if (args[i] == "TARGET") {
doing = DoingTarget;
} else if (args[i] == "PARALLEL_LEVEL") {
doing = DoingParallel;
} else if (doing == DoingConfiguration) {
doing = DoingNone;
configuration = args[i];
@@ -52,6 +56,9 @@ bool MainSignature(std::vector<std::string> const& args,
} else if (doing == DoingTarget) {
doing = DoingNone;
target = args[i];
} else if (doing == DoingParallel) {
doing = DoingNone;
parallel = args[i];
} else {
status.SetError(cmStrCat("unknown argument \"", args[i], "\""));
return false;
@@ -77,7 +84,7 @@ bool MainSignature(std::vector<std::string> const& args,
}
std::string makecommand = mf.GetGlobalGenerator()->GenerateCMakeBuildCommand(
target, configuration, "", "", mf.IgnoreErrorsCMP0061());
target, configuration, parallel, "", mf.IgnoreErrorsCMP0061());
mf.AddDefinition(variable, makecommand);