diff options
author | Björn Schäpers <bjoern@hazardy.de> | 2023-12-08 23:42:54 +0100 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2024-01-11 17:47:49 +0000 |
commit | aa044048f0b3573ddda09d1b7a4483af9eed3de4 (patch) | |
tree | b952317f5916f7e5954c7ae35542d9ac045b32d1 /share | |
parent | 167799f31c8ca3cfd79394b6c3fe8389c7df4de1 (diff) |
protobuf: Usable without qbspkgconfigprovider
It only fails with "Can't find cpp protobuf runtime. Make sure .pc files
are present" which is not helpful, since they are present.
Additionally remove the grpcpp to grpc++ mapping in both pkg-config
probes.
This kind of amends 1772df50a3bacd91ba8125ececf774aa0e6311f9, I readded
the tests.
Task-number: QBS-1663
Change-Id: I73b7b76a66cc2b8eea5dddd57e5221715b6e6014
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs | 6 | ||||
-rw-r--r-- | share/qbs/module-providers/qbspkgconfig.qbs | 3 | ||||
-rw-r--r-- | share/qbs/modules/protobuf/cpp/protobufcpp.qbs | 9 |
3 files changed, 11 insertions, 7 deletions
diff --git a/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs b/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs index 61a9c0b74..0fe81c3cc 100644 --- a/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs +++ b/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs @@ -85,6 +85,12 @@ Probe { && p.exec(executable, versionArgs.concat(packageNames)) !== 0) { return; } + + // protobuf is reserved as qbs module name, which depends on the protobuflib module + packageNames = packageNames.map(function(name) { + return name === "protobuflib" ? "protobuf" : name; + }); + var args = packageNames; if (p.exec(executable, args.concat([ '--cflags' ])) === 0) { stdout = p.readStdOut().trim(); diff --git a/share/qbs/module-providers/qbspkgconfig.qbs b/share/qbs/module-providers/qbspkgconfig.qbs index aebed0ab3..0c6c99293 100644 --- a/share/qbs/module-providers/qbspkgconfig.qbs +++ b/share/qbs/module-providers/qbspkgconfig.qbs @@ -144,8 +144,7 @@ ModuleProvider { // TODO: ponder how we can solve forward mapping with Packages so we can fill deps var moduleMapping = { - "protobuf": "protobuflib", - "grpc++": "grpcpp" + "protobuf": "protobuflib" } var reverseMapping = {} for (var key in moduleMapping) diff --git a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs index 9a8c55524..b5dab2372 100644 --- a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs +++ b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs @@ -19,14 +19,13 @@ ProtobufBase { Depends { name: "protobuflib"; condition: _linkLibraries; - required: false; - enableFallback: false + required: false } Depends { - name: "grpcpp"; + name: "grpc++"; + id: grpcpp condition: _linkLibraries && useGrpc; - required: false; - enableFallback: false + required: false } property path grpcPluginPath: grpcPluginProbe.filePath |