From 481c2a0a47d9c97bfa3d09869591e47e37f75c0b Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sun, 7 Mar 2021 16:34:41 +0300 Subject: Bump version to 1.18.2 Change-Id: I45dd78f2579555959742693d021613735d58c764 Reviewed-by: Denis Shienkov --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ec6d649be..b57fc7228 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.1 +1.18.2 -- cgit v1.2.1 From 0d42ca4d0f8b0866b51ac9587f68a6550ca6d3fe Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sun, 7 Mar 2021 16:46:59 +0300 Subject: protobuf: fix accessing undefined object Always execute Probes to find files protobuf libs and headers even when the user passes path to those manually. This is required for the correct search of different library variants. This amends 87fdf5002. Change-Id: Ic7b9368b2b17925da33fd16299e31fd016043466 Reviewed-by: Kai Dohmen Reviewed-by: Christian Kandeler --- share/qbs/modules/protobuf/cpp/protobufcpp.qbs | 41 ++++++++++++++++---------- share/qbs/modules/protobuf/nanopb/nanopb.qbs | 23 ++++++++------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs index 50caf058a..b443b4dbf 100644 --- a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs +++ b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs @@ -7,20 +7,21 @@ 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 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; } @@ -36,9 +37,9 @@ ProtobufBase { cpp.libraryPaths: { 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; } @@ -54,9 +55,9 @@ ProtobufBase { } cpp.includePaths: { var result = [outputDir]; - if (includePath) + if (includeProbe.found) result.push(includePath); - if (useGrpc && grpcIncludePath) + if (useGrpc && grpcIncludeProbe.found) result.push(grpcIncludePath); return result; } @@ -96,6 +97,8 @@ ProtobufBase { Probes.IncludeProbe { id: includeProbe names: "google/protobuf/message.h" + platformSearchPaths: includePath ? [] : base + searchPaths: includePath ? [includePath] : [] } Probes.LibraryProbe { @@ -104,33 +107,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 (!HelperFunctions.checkPath(includePath)) + if (!includeProbe.found) throw "Can't find cpp protobuf include files. Please set the includePath property."; - if (!HelperFunctions.checkPath(libraryPath)) + if (!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 (!HelperFunctions.checkPath(grpcIncludePath)) + if (!grpcIncludeProbe.found) throw "Can't find grpc++ include files. Please set the grpcIncludePath property."; - if (!HelperFunctions.checkPath(grpcLibraryPath)) + if (!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..ec8df7db3 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; } @@ -79,6 +80,8 @@ ProtobufBase { "protobuf-nanopb", "protobuf-nanopbd", ] + platformSearchPaths: libraryPath ? [] : base + searchPaths: libraryPath ? [libraryPath] : [] } Probes.BinaryProbe { @@ -89,9 +92,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."; -- cgit v1.2.1 From a5c9fa92c86982e0260f691ea27b790748851db6 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Wed, 17 Mar 2021 12:49:18 +0300 Subject: protobuf: fix setting includePath in nanopb.qbs This amends 0d42ca4d0f8b0866b51ac9587f68a6550ca6d3fe. Change-Id: I3650056431c51ae8d67575e217bfaebcf49b4f08 Reviewed-by: Kai Dohmen Reviewed-by: Denis Shienkov --- share/qbs/modules/protobuf/nanopb/nanopb.qbs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/qbs/modules/protobuf/nanopb/nanopb.qbs b/share/qbs/modules/protobuf/nanopb/nanopb.qbs index ec8df7db3..86cd93600 100644 --- a/share/qbs/modules/protobuf/nanopb/nanopb.qbs +++ b/share/qbs/modules/protobuf/nanopb/nanopb.qbs @@ -72,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 { -- cgit v1.2.1