diff options
author | Kai Dohmen <kdohmen@lumino.de> | 2020-12-09 13:39:04 +0100 |
---|---|---|
committer | Kai Dohmen <psykai1993@googlemail.com> | 2020-12-12 09:12:08 +0000 |
commit | 1bd9601c65449a961e2a9c442fec144089d80696 (patch) | |
tree | dea6dde5f4813c2a2c5192f7456430a7ad01b9a1 /share/qbs/modules/protobuf/nanopb/nanopb.qbs | |
parent | 647ad9092207f0d317c3f3ac70fd8810d7929462 (diff) |
Probe for release and debug version of protobuf libraries
When cpp protobuf or nanopb gets compiled as debug build the library
gets the suffix "d". The library probe will search for the release name
and the debug name. If no library could be found let the user set the
library name.
Change-Id: I6574986e527fe4484935e58ccf45c86feee230e5
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share/qbs/modules/protobuf/nanopb/nanopb.qbs')
-rw-r--r-- | share/qbs/modules/protobuf/nanopb/nanopb.qbs | 18 |
1 files changed, 16 insertions, 2 deletions
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 { |