diff --git a/src/tools/qtprotoccommon/generatorbase.cpp b/src/tools/qtprotoccommon/generatorbase.cpp index 00b453bb..5a49a0a1 100644 --- a/src/tools/qtprotoccommon/generatorbase.cpp +++ b/src/tools/qtprotoccommon/generatorbase.cpp @@ -29,11 +29,6 @@ bool GeneratorBase::GenerateAll(const std::vector &files return CodeGenerator::GenerateAll(files, parameter, generatorContext, error); } -uint64_t GeneratorBase::GetSupportedFeatures() const -{ - return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL; -} - std::string GeneratorBase::generateBaseName(const FileDescriptor *file, const std::string &name) { std::string outFileBasename; diff --git a/src/tools/qtprotoccommon/generatorbase.h b/src/tools/qtprotoccommon/generatorbase.h index e1b52cf0..084789e8 100644 --- a/src/tools/qtprotoccommon/generatorbase.h +++ b/src/tools/qtprotoccommon/generatorbase.h @@ -6,6 +6,7 @@ #define GENERATORBASE_H #include +#include #include #include @@ -37,7 +38,17 @@ public: std::string *error) const override; bool HasGenerateAll() const override { return true; } - uint64_t GetSupportedFeatures() const override; +// TODO: This suppresses the build issue with old protobuf versions. Since we don't have the +// strict protobuf versions that we support this work around will be here for a while, since +// yocto builds quite old protobuf by now. See QTBUG-115702. +#if PROTOBUF_VERSION < 3012000 + uint64_t GetSupportedFeatures() const { return 0; }; +#else + uint64_t GetSupportedFeatures() const override + { + return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL; + } +#endif static void printDisclaimer(::google::protobuf::io::Printer *printer); void OpenFileNamespaces(const ::google::protobuf::FileDescriptor *file, @@ -51,4 +62,6 @@ protected: }; } // namespace qtprotoccommon +#include + #endif // GENERATORBASE_H