diff options
Diffstat (limited to 'share/qbs/modules/protobuf/cpp/protobufcpp.qbs')
-rw-r--r-- | share/qbs/modules/protobuf/cpp/protobufcpp.qbs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs index b443b4dbf..36b92dd30 100644 --- a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs +++ b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs @@ -12,6 +12,8 @@ ProtobufBase { property bool useGrpc: false + property bool _linkLibraries: true + property string grpcIncludePath: grpcIncludeProbe.found ? grpcIncludeProbe.path : undefined property string grpcLibraryPath: grpcLibraryProbe.found ? grpcLibraryProbe.path : undefined @@ -36,6 +38,9 @@ ProtobufBase { } cpp.libraryPaths: { + if (!_linkLibraries) + return []; + var result = []; if (libraryProbe.found) result.push(libraryProbe.path); @@ -44,6 +49,9 @@ ProtobufBase { return result; } cpp.dynamicLibraries: { + if (!_linkLibraries) + return []; + var result = []; if (_libraryName) result.push(_libraryName) @@ -54,6 +62,9 @@ ProtobufBase { return result; } cpp.includePaths: { + if (!_linkLibraries) + return [outputDir]; + var result = [outputDir]; if (includeProbe.found) result.push(includePath); @@ -129,17 +140,17 @@ ProtobufBase { validate: { HelperFunctions.validateCompiler(compilerName, compilerPath); - if (!includeProbe.found) + if (_linkLibraries && !includeProbe.found) throw "Can't find cpp protobuf include files. Please set the includePath property."; - if (!libraryProbe.found) + 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 (!grpcIncludeProbe.found) + if (_linkLibraries && !grpcIncludeProbe.found) throw "Can't find grpc++ include files. Please set the grpcIncludePath property."; - if (!grpcLibraryProbe.found) + if (_linkLibraries && !grpcLibraryProbe.found) throw "Can't find grpc++ library. Please set the grpcLibraryPath property."; } } |