aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-07-24 12:44:28 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-08-08 11:18:45 +0000
commit0bc341e3dcba1f561a685d72cfa0f4b1a7f697dd (patch)
treebc79d5bc3f8bbbda56b72b0825c70bb71127d863 /share
parent43e3b7ad7e5e68bae839feb74cdbcde48424c065 (diff)
Add support for job pools
Commands can now be assigned to an arbitrary job pool and a limit for the number of concurrently running jobs in such pools can be provided in a number of ways: - via the build command line: qbs --job-limits linker:1 - via the settings: qbs config preferences.jobLimit.linker 1 - in a project file: JobLimit { jobPool: "linker"; jobCount: 1 } We provide two job pools ourselves with the cpp module: "compiler" and "linker". [ChangeLog] Added the concept of job pools for limiting concurrent execution of commands by type Task-number: QBS-743 Change-Id: Ib3f361dbc73093e342bf0eba0daf2079a2b3a8ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs1
-rw-r--r--share/qbs/modules/cpp/gcc.js3
-rw-r--r--share/qbs/modules/cpp/msvc.js2
-rw-r--r--share/qbs/modules/cpp/windows-msvc.qbs3
4 files changed, 9 insertions, 0 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index 423d964d5..79575ca2b 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -494,6 +494,7 @@ CppModule {
var cmd = new Command(product.cpp.archiverPath, args);
cmd.description = 'creating ' + output.fileName;
cmd.highlight = 'linker'
+ cmd.jobPool = "linker";
cmd.responseFileUsagePrefix = '@';
return cmd;
}
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 6e8622b93..ff7867b25 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -984,6 +984,7 @@ function prepareAssembler(project, product, inputs, outputs, input, output) {
var cmd = new Command(assemblerPath, args);
cmd.description = "assembling " + input.fileName;
cmd.highlight = "compiler";
+ cmd.jobPool = "assembler";
return cmd;
}
@@ -1055,6 +1056,7 @@ function prepareCompiler(project, product, inputs, outputs, input, output, expli
if (pchOutput)
cmd.description += ' (' + compilerInfo.tag + ')';
cmd.highlight = "compiler";
+ cmd.jobPool = "compiler";
cmd.relevantEnvironmentVariables = compilerEnvVars(input, compilerInfo);
cmd.responseFileArgumentIndex = wrapperArgsLength;
cmd.responseFileUsagePrefix = '@';
@@ -1274,6 +1276,7 @@ function prepareLinker(project, product, inputs, outputs, input, output) {
cmd = new Command(linkerPath, args);
cmd.description = 'linking ' + primaryOutput.fileName;
cmd.highlight = 'linker';
+ cmd.jobPool = "linker";
cmd.relevantEnvironmentVariables = linkerEnvVars(product, inputs);
cmd.responseFileArgumentIndex = responseFileArgumentIndex;
cmd.responseFileUsagePrefix = useQnxResponseFileHack ? "-Wl,@" : "@";
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js
index d6df99dc2..196e5ae43 100644
--- a/share/qbs/modules/cpp/msvc.js
+++ b/share/qbs/modules/cpp/msvc.js
@@ -246,6 +246,7 @@ function prepareCompiler(project, product, inputs, outputs, input, output, expli
if (pchOutput)
cmd.description += ' (' + tag + ')';
cmd.highlight = "compiler";
+ cmd.jobPool = "compiler";
cmd.workingDirectory = product.buildDirectory;
cmd.responseFileUsagePrefix = '@';
// cl.exe outputs the cpp file name. We filter that out.
@@ -469,6 +470,7 @@ function prepareLinker(project, product, inputs, outputs, input, output) {
var cmd = new Command(linkerPath, args)
cmd.description = 'linking ' + primaryOutput.fileName;
cmd.highlight = 'linker';
+ cmd.jobPool = "linker";
cmd.relevantEnvironmentVariables = ["LINK", "_LINK_", "LIB", "TMP"];
cmd.workingDirectory = FileInfo.path(primaryOutput.filePath)
cmd.responseFileUsagePrefix = '@';
diff --git a/share/qbs/modules/cpp/windows-msvc.qbs b/share/qbs/modules/cpp/windows-msvc.qbs
index 18bc9705c..b22984a6e 100644
--- a/share/qbs/modules/cpp/windows-msvc.qbs
+++ b/share/qbs/modules/cpp/windows-msvc.qbs
@@ -287,6 +287,7 @@ CppModule {
var cmd = new Command("lib.exe", args);
cmd.description = 'creating ' + lib.fileName;
cmd.highlight = 'linker';
+ cmd.jobPool = "linker";
cmd.workingDirectory = FileInfo.path(lib.filePath)
cmd.responseFileUsagePrefix = '@';
return cmd;
@@ -339,6 +340,7 @@ CppModule {
var cmd = new Command('rc', args);
cmd.description = 'compiling ' + input.fileName;
cmd.highlight = 'compiler';
+ cmd.jobPool = "compiler";
if (!hasNoLogo) {
// Remove the first two lines of stdout. That's the logo.
@@ -375,6 +377,7 @@ CppModule {
ModUtils.moduleProperty(input, 'flags', 'asm'));
var cmd = new Command(product.cpp.assemblerPath, args);
cmd.description = "assembling " + input.fileName;
+ cmd.jobPool = "assembler";
cmd.inputFileName = input.fileName;
cmd.stdoutFilterFunction = function(output) {
var lines = output.split("\r\n").filter(function (s) {