From b276fea04f8ae6fb668b70520896eadcd55a62be Mon Sep 17 00:00:00 2001 From: Doekin <105162544+Doekin@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:05:50 +0800 Subject: [PATCH] fix protobuf-cpp build on mingw-clang (#5877) --- packages/p/protobuf-cpp/xmake.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/p/protobuf-cpp/xmake.lua b/packages/p/protobuf-cpp/xmake.lua index 0975b6a00..5464cbb48 100644 --- a/packages/p/protobuf-cpp/xmake.lua +++ b/packages/p/protobuf-cpp/xmake.lua @@ -48,7 +48,7 @@ package("protobuf-cpp") add_links("protoc", "protobuf", "utf8_range", "utf8_validity") end - if is_plat("linux", "bsd") then + if is_plat("linux", "bsd", "mingw") then add_syslinks("m", "pthread") end @@ -117,6 +117,9 @@ package("protobuf-cpp") if version:ge("26.1") then io.replace("cmake/abseil-cpp.cmake", "BUILD_SHARED_LIBS AND MSVC", "FALSE", {plain = true}) end + if package:is_plat("windows", "mingw") then + io.replace("src/google/protobuf/port_def.inc", "#define PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED", "", {plain = true}) + end local configs = { "-Dprotobuf_BUILD_TESTS=OFF",