aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThe Qt Project <gerrit-noreply@qt-project.org>2021-03-30 14:32:33 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2021-03-30 14:32:33 +0000
commit980a5fc3f61f42bdd8cdee832235861e095e8e01 (patch)
treeec2d18af0e51bd74daebb9e739ff59ba42b7a3fc
parent57fc1cf85bdec6928fc088729c99fb8720c7c804 (diff)
parent800a41519ff2c9266578dd6f12159ccd7be31f3e (diff)
Merge "Merge branch '1.18' into master"
-rw-r--r--share/qbs/modules/protobuf/cpp/protobufcpp.qbs41
-rw-r--r--share/qbs/modules/protobuf/nanopb/nanopb.qbs25
2 files changed, 40 insertions, 26 deletions
diff --git a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
index abfe77dc1..36b92dd30 100644
--- a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
+++ b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
@@ -7,22 +7,23 @@ import "../protobufbase.qbs" as ProtobufBase
import "../protobuf.js" as HelperFunctions
ProtobufBase {
- property string includePath: includeProbe.path
- property string libraryPath: libraryProbe.path
+ property string includePath: includeProbe.found ? includeProbe.path : undefined
+ property string libraryPath: libraryProbe.found ? libraryProbe.path : undefined
property bool useGrpc: false
property bool _linkLibraries: true
- property string grpcIncludePath: grpcIncludeProbe.path
- property string grpcLibraryPath: grpcLibraryProbe.path
+ property string grpcIncludePath: grpcIncludeProbe.found ? grpcIncludeProbe.path : undefined
+ property string grpcLibraryPath: grpcLibraryProbe.found ? grpcLibraryProbe.path : undefined
readonly property string _libraryName: {
var libraryName;
- if (libraryProbe.found)
+ if (libraryProbe.found) {
libraryName = FileInfo.baseName(libraryProbe.fileName);
- if (libraryName.startsWith("lib"))
- libraryName = libraryName.substring(3);
+ if (libraryName.startsWith("lib"))
+ libraryName = libraryName.substring(3);
+ }
return libraryName;
}
@@ -41,9 +42,9 @@ ProtobufBase {
return [];
var result = [];
- if (libraryPath)
- result.push(libraryPath);
- if (useGrpc && grpcLibraryPath)
+ if (libraryProbe.found)
+ result.push(libraryProbe.path);
+ if (useGrpc && grpcLibraryProbe.found)
result.push(grpcLibraryPath);
return result;
}
@@ -65,9 +66,9 @@ ProtobufBase {
return [outputDir];
var result = [outputDir];
- if (includePath)
+ if (includeProbe.found)
result.push(includePath);
- if (useGrpc && grpcIncludePath)
+ if (useGrpc && grpcIncludeProbe.found)
result.push(grpcIncludePath);
return result;
}
@@ -107,6 +108,8 @@ ProtobufBase {
Probes.IncludeProbe {
id: includeProbe
names: "google/protobuf/message.h"
+ platformSearchPaths: includePath ? [] : base
+ searchPaths: includePath ? [includePath] : []
}
Probes.LibraryProbe {
@@ -115,33 +118,39 @@ ProtobufBase {
"protobuf",
"protobufd",
]
+ platformSearchPaths: libraryPath ? [] : base
+ searchPaths: libraryPath ? [libraryPath] : []
}
Probes.IncludeProbe {
id: grpcIncludeProbe
pathSuffixes: "grpc++"
names: "grpc++.h"
+ platformSearchPaths: grpcIncludePath ? [] : base
+ searchPaths: grpcIncludePath ? [grpcIncludePath] : []
}
Probes.LibraryProbe {
id: grpcLibraryProbe
names: "grpc++"
+ platformSearchPaths: grpcLibraryPath ? [] : base
+ searchPaths: grpcLibraryPath ? [grpcLibraryPath] : []
}
validate: {
HelperFunctions.validateCompiler(compilerName, compilerPath);
- if (_linkLibraries && !HelperFunctions.checkPath(includePath))
+ if (_linkLibraries && !includeProbe.found)
throw "Can't find cpp protobuf include files. Please set the includePath property.";
- if (_linkLibraries && !HelperFunctions.checkPath(libraryPath))
+ if (_linkLibraries && !libraryProbe.found)
throw "Can't find cpp protobuf library. Please set the libraryPath property.";
if (useGrpc) {
if (!File.exists(grpcPluginPath))
throw "Can't find grpc_cpp_plugin plugin. Please set the grpcPluginPath property.";
- if (_linkLibraries && !HelperFunctions.checkPath(grpcIncludePath))
+ if (_linkLibraries && !grpcIncludeProbe.found)
throw "Can't find grpc++ include files. Please set the grpcIncludePath property.";
- if (_linkLibraries && !HelperFunctions.checkPath(grpcLibraryPath))
+ if (_linkLibraries && !grpcLibraryProbe.found)
throw "Can't find grpc++ library. Please set the grpcLibraryPath property.";
}
}
diff --git a/share/qbs/modules/protobuf/nanopb/nanopb.qbs b/share/qbs/modules/protobuf/nanopb/nanopb.qbs
index 0a5e4e807..86cd93600 100644
--- a/share/qbs/modules/protobuf/nanopb/nanopb.qbs
+++ b/share/qbs/modules/protobuf/nanopb/nanopb.qbs
@@ -7,17 +7,18 @@ import "../protobufbase.qbs" as ProtobufBase
import "../protobuf.js" as HelperFunctions
ProtobufBase {
- property string includePath: includeProbe.path
- property string libraryPath: libraryProbe.path
+ property string includePath: includeProbe.found ? includeProbe.path : undefined
+ property string libraryPath: libraryProbe.found ? libraryProbe.path : undefined
property string pluginPath: pluginProbe.filePath
property string pluginName: "protoc-gen-nanopb"
readonly property string _plugin: "protoc-gen-nanopb=" + pluginPath
readonly property string _libraryName: {
var libraryName;
- if (libraryProbe.found)
+ if (libraryProbe.found) {
libraryName = FileInfo.baseName(libraryProbe.fileName);
- if (libraryName.startsWith("lib"))
- libraryName = libraryName.substring(3);
+ if (libraryName.startsWith("lib"))
+ libraryName = libraryName.substring(3);
+ }
return libraryName;
}
@@ -25,8 +26,8 @@ ProtobufBase {
cpp.libraryPaths: {
var result = [];
- if (libraryPath)
- result.push(libraryPath);
+ if (libraryProbe.found)
+ result.push(libraryProbe.path);
return result;
}
cpp.dynamicLibraries: {
@@ -37,7 +38,7 @@ ProtobufBase {
}
cpp.includePaths: {
var result = [outputDir];
- if (includePath)
+ if (includeProbe.found)
result.push(includePath);
return result;
}
@@ -71,6 +72,8 @@ ProtobufBase {
Probes.IncludeProbe {
id: includeProbe
names: ["pb.h", "pb_encode.h", "pb_decode.h", "pb_common.h"]
+ platformSearchPaths: includePath ? [] : base
+ searchPaths: includePath ? [includePath] : []
}
Probes.LibraryProbe {
@@ -79,6 +82,8 @@ ProtobufBase {
"protobuf-nanopb",
"protobuf-nanopbd",
]
+ platformSearchPaths: libraryPath ? [] : base
+ searchPaths: libraryPath ? [libraryPath] : []
}
Probes.BinaryProbe {
@@ -89,9 +94,9 @@ ProtobufBase {
validate: {
HelperFunctions.validateCompiler(compilerName, compilerPath);
- if (!HelperFunctions.checkPath(includePath))
+ if (!includeProbe.found)
throw "Can't find nanopb protobuf include files. Please set the includePath property.";
- if (!HelperFunctions.checkPath(libraryPath))
+ if (!libraryProbe.found)
throw "Can't find nanopb protobuf library. Please set the libraryPath property.";
if (!HelperFunctions.checkPath(pluginPath))
throw "Can't find nanopb protobuf plugin. Please set the pluginPath property.";