summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx9
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);
}