From dcaed20863acce343a8abe7d9dd46a7e5b0edad5 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Sat, 17 May 2025 13:47:37 +0800 Subject: [PATCH] chore: update protobuf version to 31.0 and use C++ lite runtime (#417) --- core/server/gen/libcore.proto | 1 + script/build_deps_all.sh | 3 +-- src/api/gRPC.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/server/gen/libcore.proto b/core/server/gen/libcore.proto index d53085a..7c91828 100644 --- a/core/server/gen/libcore.proto +++ b/core/server/gen/libcore.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package libcore; option go_package = "grpc_server/gen"; +option optimize_for = LITE_RUNTIME; service LibcoreService { rpc Exit(EmptyReq) returns (EmptyResp); diff --git a/script/build_deps_all.sh b/script/build_deps_all.sh index 5452a75..fcb3a59 100755 --- a/script/build_deps_all.sh +++ b/script/build_deps_all.sh @@ -36,7 +36,7 @@ ninja && ninja install cd ../.. #### protobuf #### -git clone --recurse-submodules -b v30.2 --depth 1 --shallow-submodules https://github.com/parhelia512/protobuf +git clone --recurse-submodules -b v31.0 --depth 1 --shallow-submodules https://github.com/protocolbuffers/protobuf mkdir -p protobuf/build cd protobuf/build @@ -44,7 +44,6 @@ cd protobuf/build $cmake .. -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ - -Dprotobuf_MSVC_STATIC_RUNTIME=OFF \ -Dprotobuf_BUILD_TESTS=OFF \ -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \ -Dprotobuf_BUILD_PROTOBUF_BINARIES=ON \ diff --git a/src/api/gRPC.cpp b/src/api/gRPC.cpp index 28567a2..2af9f14 100644 --- a/src/api/gRPC.cpp +++ b/src/api/gRPC.cpp @@ -144,7 +144,7 @@ namespace QtGrpc { } QNetworkReply::NetworkError Call(const QString &methodName, - const google::protobuf::Message &req, google::protobuf::Message *rsp, + const google::protobuf::MessageLite &req, google::protobuf::MessageLite *rsp, int timeout_ms = 0) { if (!NekoGui::dataStore->core_running) return QNetworkReply::NetworkError(-1919);