Browse Source

Fix wellknown types build

Tatiana Borisova 5 years ago
parent
commit
7d1b0511cb
2 changed files with 3 additions and 2 deletions
  1. 2 2
      src/generator/classgeneratorbase.cpp
  2. 1 0
      src/wellknowntypes/CMakeLists.txt

+ 2 - 2
src/generator/classgeneratorbase.cpp

@@ -196,7 +196,7 @@ std::string ClassGeneratorBase::getTypeName(const FieldDescriptor *field, const
             if (field->is_repeated()) {
                 if (field->type() == FieldDescriptor::TYPE_FLOAT
                         || field->type() == FieldDescriptor::TYPE_DOUBLE) {
-                    typeName[0] = ::toupper(typeName[0]);
+                    typeName[0] =  static_cast<char>(::toupper(typeName[0]));
                     typeName = namespaceQtProtoDefinition.append(typeName);
                 }
                 typeName.append("List");
@@ -264,7 +264,7 @@ void ClassGeneratorBase::getMethodParameters(const MethodDescriptor *method, std
     std::string outputTypeName = method->output_type()->full_name();
     std::string methodName = method->name();
     std::string methodNameUpper = method->name();
-    methodNameUpper[0] = ::toupper(methodNameUpper[0]);
+    methodNameUpper[0] =  static_cast<char>(::toupper(methodNameUpper[0]));
     utils::replace(inputTypeName, ".", "::");
     utils::replace(outputTypeName, ".", "::");
     parameters = {{"classname", mClassName},

+ 1 - 0
src/wellknowntypes/CMakeLists.txt

@@ -57,6 +57,7 @@ function(add_wellknowntype VARIABLE TYPENAME)
     else()
         set(${VARIABLE} ${${VARIABLE}} -Wl,--whole-archive ${QtProtobuf_GENERATED} -Wl,--no-whole-archive PARENT_SCOPE)
     endif()
+    add_dependencies(${TARGET} ${QtProtobuf_GENERATED})
 endfunction()
 
 add_library(${TARGET} SHARED ${SOURCES})