diff --git a/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt b/protoc-gen-rust-grpc/src/cpp_source/CMakeLists.txt index 8e5874654..84da990cd 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,12 @@ 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}) + # Add the protoc-gen-rust-grpc executable and installation rules if(BUILD_PLUGIN) add_executable(protoc-gen-rust-grpc