summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomTargetCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r--Source/cmAddCustomTargetCommand.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 8240d3e..0ecd5f5 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -52,6 +52,7 @@ bool cmAddCustomTargetCommand::InitialPass(
std::string comment_buffer;
const char* comment = nullptr;
std::vector<std::string> sources;
+ std::string job_pool;
// Keep track of parser state.
enum tdoing
@@ -62,6 +63,7 @@ bool cmAddCustomTargetCommand::InitialPass(
doing_working_directory,
doing_comment,
doing_source,
+ doing_job_pool,
doing_nothing
};
tdoing doing = doing_command;
@@ -97,6 +99,8 @@ bool cmAddCustomTargetCommand::InitialPass(
command_expand_lists = true;
} else if (copy == "COMMENT") {
doing = doing_comment;
+ } else if (copy == "JOB_POOL") {
+ doing = doing_job_pool;
} else if (copy == "COMMAND") {
doing = doing_command;
@@ -137,6 +141,9 @@ bool cmAddCustomTargetCommand::InitialPass(
case doing_source:
sources.push_back(copy);
break;
+ case doing_job_pool:
+ job_pool = copy;
+ break;
default:
this->SetError("Wrong syntax. Unknown type of argument.");
return false;
@@ -200,12 +207,17 @@ bool cmAddCustomTargetCommand::InitialPass(
return true;
}
+ if (uses_terminal && !job_pool.empty()) {
+ this->SetError("JOB_POOL is shadowed by USES_TERMINAL.");
+ return false;
+ }
+
// Add the utility target to the makefile.
bool escapeOldStyle = !verbatim;
cmTarget* target = this->Makefile->AddUtilityCommand(
targetName, cmMakefile::TargetOrigin::Project, excludeFromAll,
working_directory.c_str(), byproducts, depends, commandLines,
- escapeOldStyle, comment, uses_terminal, command_expand_lists);
+ escapeOldStyle, comment, uses_terminal, command_expand_lists, job_pool);
// Add additional user-specified source files to the target.
target->AddSources(sources);