diff options
author | Brad King <brad.king@kitware.com> | 2019-05-15 13:20:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-15 13:21:08 (GMT) |
commit | 0064edf4173fad72749da2c66753387e9a671223 (patch) | |
tree | ed3b08a0ecf709ca9281cdea448945bcba957a01 /Source/cmAddCustomTargetCommand.cxx | |
parent | ac0411f1662f64fe1320e22e5a8906b8a40d6677 (diff) | |
parent | 9f76961de87d8911d13867d469c38087e47a0b60 (diff) | |
download | CMake-0064edf4173fad72749da2c66753387e9a671223.zip CMake-0064edf4173fad72749da2c66753387e9a671223.tar.gz CMake-0064edf4173fad72749da2c66753387e9a671223.tar.bz2 |
Merge topic 'ninja-pool-custom-command'
9f76961de8 Support job pools in custom commands and targets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3308
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r-- | Source/cmAddCustomTargetCommand.cxx | 14 |
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); |