aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2020-07-10 15:02:28 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2020-07-13 20:03:38 +0000
commit157121fca1aeb3d3d5f330fd40cc1239c155e2bb (patch)
tree0438c7a24ded2f04a3cb5244f685d934f0199fbd
parentde0d8be51e4069a698c2564d48909efca53a2350 (diff)
protobuf: Do not call outputDir() that often
Change-Id: I1f436eb2d15393fc010a4ab29f879ae0828b0cc3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--share/qbs/modules/protobuf/cpp/protobufcpp.qbs9
-rw-r--r--share/qbs/modules/protobuf/objc/protobufobjc.qbs5
-rw-r--r--share/qbs/modules/protobuf/protobuf.js6
3 files changed, 10 insertions, 10 deletions
diff --git a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
index 2697eb227..bd3d94929 100644
--- a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
+++ b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
@@ -54,14 +54,15 @@ ProtobufBase {
inputs: ["protobuf.input", "protobuf.grpc"]
outputFileTags: ["hpp", "cpp"]
outputArtifacts: {
+ var outputDir = HelperFunctions.getOutputDir(input.protobuf.cpp, input);
var result = [
- HelperFunctions.cppArtifact(input.protobuf.cpp, input, "hpp", ".pb.h"),
- HelperFunctions.cppArtifact(input.protobuf.cpp, input, "cpp", ".pb.cc")
+ HelperFunctions.cppArtifact(outputDir, input, "hpp", ".pb.h"),
+ HelperFunctions.cppArtifact(outputDir, input, "cpp", ".pb.cc")
];
if (input.fileTags.contains("protobuf.grpc")) {
result.push(
- HelperFunctions.cppArtifact(input.protobuf.cpp, input, "hpp", ".grpc.pb.h"),
- HelperFunctions.cppArtifact(input.protobuf.cpp, input, "cpp", ".grpc.pb.cc"));
+ HelperFunctions.cppArtifact(outputDir, input, "hpp", ".grpc.pb.h"),
+ HelperFunctions.cppArtifact(outputDir, input, "cpp", ".grpc.pb.cc"));
}
return result;
diff --git a/share/qbs/modules/protobuf/objc/protobufobjc.qbs b/share/qbs/modules/protobuf/objc/protobufobjc.qbs
index 67057fb26..9a910bb72 100644
--- a/share/qbs/modules/protobuf/objc/protobufobjc.qbs
+++ b/share/qbs/modules/protobuf/objc/protobufobjc.qbs
@@ -23,9 +23,10 @@ ProtobufBase {
inputs: ["protobuf.input"]
outputFileTags: ["hpp", "objc"]
outputArtifacts: {
+ var outputDir = HelperFunctions.getOutputDir(input.protobuf.objc, input);
return [
- HelperFunctions.objcArtifact(input.protobuf.objc, input, "hpp", ".pbobjc.h"),
- HelperFunctions.objcArtifact(input.protobuf.objc, input, "objc", ".pbobjc.m")
+ HelperFunctions.objcArtifact(outputDir, input, "hpp", ".pbobjc.h"),
+ HelperFunctions.objcArtifact(outputDir, input, "objc", ".pbobjc.m")
];
}
diff --git a/share/qbs/modules/protobuf/protobuf.js b/share/qbs/modules/protobuf/protobuf.js
index 3c70dfef0..8ab535abd 100644
--- a/share/qbs/modules/protobuf/protobuf.js
+++ b/share/qbs/modules/protobuf/protobuf.js
@@ -69,8 +69,7 @@ function getOutputDir(module, input) {
return outputDir;
}
-function cppArtifact(module, input, tag, suffix) {
- var outputDir = getOutputDir(module, input);
+function cppArtifact(outputDir, input, tag, suffix) {
return {
fileTags: [tag],
filePath: FileInfo.joinPaths(outputDir, FileInfo.baseName(input.fileName) + suffix),
@@ -81,8 +80,7 @@ function cppArtifact(module, input, tag, suffix) {
};
}
-function objcArtifact(module, input, tag, suffix) {
- var outputDir = getOutputDir(module, input);
+function objcArtifact(outputDir, input, tag, suffix) {
return {
fileTags: [tag],
filePath: FileInfo.joinPaths(