diff options
author | Brad King <brad.king@kitware.com> | 2023-07-26 14:19:36 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-07-26 14:19:46 (GMT) |
commit | 5a164f1649d1ed76a0864dc43acced58c8534982 (patch) | |
tree | 767fb6c009cf56dddbb79d28fa2c543376de2404 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 06839c419f7f3ebfde8109bfbcb8c5b15696a055 (diff) | |
parent | 3825d6ec981d20ee55b12aed8cc8f94ab1afc88f (diff) | |
download | CMake-5a164f1649d1ed76a0864dc43acced58c8534982.zip CMake-5a164f1649d1ed76a0864dc43acced58c8534982.tar.gz CMake-5a164f1649d1ed76a0864dc43acced58c8534982.tar.bz2 |
Merge topic 'jobserver-fix'
3825d6ec98 add_custom_{command,target}: Teach JOB_SERVER_AWARE about WORKING_DIRECTORY
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8644
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 3c6b303..e26a6ea 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1080,6 +1080,15 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( // Setup the proper working directory for the commands. this->CreateCDCommand(commands1, dir, relative); + cmGlobalUnixMakefileGenerator3* gg = + static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator); + + // Prefix the commands with the jobserver prefix "+" + if (ccg.GetCC().GetJobserverAware() && gg->IsGNUMakeJobServerAware()) { + std::transform(commands1.begin(), commands1.end(), commands1.begin(), + [](std::string const& cmd) { return cmStrCat("+", cmd); }); + } + // push back the custom commands cm::append(commands, commands1); } |