aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs')
-rw-r--r--share/qbs/modules/protobuf/cpp/protobufcpp.qbs16
-rw-r--r--share/qbs/modules/protobuf/nanopb/nanopb.qbs18
2 files changed, 30 insertions, 4 deletions
diff --git a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
index 9f2dbc7af..47d1a60c1 100644
--- a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
+++ b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs
@@ -15,6 +15,13 @@ ProtobufBase {
property string grpcIncludePath: grpcIncludeProbe.path
property string grpcLibraryPath: grpcLibraryProbe.path
+ readonly property string _libraryName: {
+ var libraryName = FileInfo.baseName(libraryProbe.fileName);
+ if (libraryName.startsWith("lib"))
+ libraryName = libraryName.substring(3);
+ return libraryName;
+ }
+
Depends { name: "cpp" }
property path grpcPluginPath: grpcPluginProbe.filePath
@@ -34,7 +41,9 @@ ProtobufBase {
return result;
}
cpp.dynamicLibraries: {
- var result = ["protobuf"];
+ var result = [];
+ if (_libraryName)
+ result.push(_libraryName)
if (qbs.targetOS.contains("unix"))
result.push("pthread");
if (useGrpc)
@@ -89,7 +98,10 @@ ProtobufBase {
Probes.LibraryProbe {
id: libraryProbe
- names: "protobuf"
+ names: [
+ "protobuf",
+ "protobufd",
+ ]
}
Probes.IncludeProbe {
diff --git a/share/qbs/modules/protobuf/nanopb/nanopb.qbs b/share/qbs/modules/protobuf/nanopb/nanopb.qbs
index 02754b8c4..36bdc9254 100644
--- a/share/qbs/modules/protobuf/nanopb/nanopb.qbs
+++ b/share/qbs/modules/protobuf/nanopb/nanopb.qbs
@@ -12,6 +12,12 @@ ProtobufBase {
property string pluginPath: pluginProbe.path
property string _plugin: "protoc-gen-nanopb=" +
FileInfo.joinPaths(pluginPath, "protoc-gen-nanopb")
+ readonly property string _libraryName: {
+ var libraryName = FileInfo.baseName(libraryProbe.fileName);
+ if (libraryName.startsWith("lib"))
+ libraryName = libraryName.substring(3);
+ return libraryName;
+ }
Depends { name: "cpp" }
@@ -21,7 +27,12 @@ ProtobufBase {
result.push(libraryPath);
return result;
}
- cpp.dynamicLibraries: "protobuf-nanopb"
+ cpp.dynamicLibraries: {
+ var result = [];
+ if (_libraryName)
+ result.push(_libraryName);
+ return result;
+ }
cpp.includePaths: {
var result = [outputDir];
if (includePath)
@@ -62,7 +73,10 @@ ProtobufBase {
Probes.LibraryProbe {
id: libraryProbe
- names: "protobuf-nanopb"
+ names: [
+ "protobuf-nanopb",
+ "protobuf-nanopbd",
+ ]
}
Probes.BinaryProbe {