From 7052b8f3ed332ec18f9da7f65502b2d58d8e811c Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Wed, 27 May 2026 14:57:59 -0700 Subject: [PATCH 1/2] protoc-gen-rust-grpc: fix cmake by getting absl before protobuf --- protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt b/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt index 8e5874654..e9c2abd2c 100644 --- a/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt +++ b/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt @@ -19,6 +19,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) if(MINGW) add_compile_options("-Wa,-mbig-obj") + add_compile_definitions(_WIN32_WINNT=0x0601) elseif(MSVC) add_compile_options("/bigobj") endif() @@ -36,9 +37,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(FetchContent) include(FetchProtobuf) -# Download and configure protobuf -fetch_protobuf(${PROTOBUF_VERSION}) - # Download and configure abseil # Abseil version that's compatible with protobuf set(ABSEIL_VERSION "20240722.0") @@ -66,6 +64,9 @@ set(CMAKE_PREFIX_PATH "" CACHE STRING "" FORCE) FetchContent_MakeAvailable(absl) +# Download and configure protobuf +fetch_protobuf(${PROTOBUF_VERSION}) + # Add the protoc-gen-rust-grpc executable and installation rules if(BUILD_PLUGIN) add_executable(protoc-gen-rust-grpc From 2fa6738d865cfb24b8b497a94f797ed768ff95cd Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Wed, 27 May 2026 15:19:01 -0700 Subject: [PATCH 2/2] another improvement to cmake --- protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt b/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt index e9c2abd2c..84da990cd 100644 --- a/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt +++ b/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt @@ -64,6 +64,9 @@ set(CMAKE_PREFIX_PATH "" CACHE STRING "" FORCE) FetchContent_MakeAvailable(absl) +# Prevent protobuf from using a local version of abseil +set(protobuf_ABSL_PROVIDER "package" CACHE STRING "Use external Abseil" FORCE) + # Download and configure protobuf fetch_protobuf(${PROTOBUF_VERSION})