Browse Source

fix protobuf-cpp build on mingw-clang (#5877)

Doekin 10 months ago
parent
commit
b276fea04f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      packages/p/protobuf-cpp/xmake.lua

+ 4 - 1
packages/p/protobuf-cpp/xmake.lua

@@ -48,7 +48,7 @@ package("protobuf-cpp")
         add_links("protoc", "protobuf", "utf8_range", "utf8_validity")
         add_links("protoc", "protobuf", "utf8_range", "utf8_validity")
     end
     end
 
 
-    if is_plat("linux", "bsd") then
+    if is_plat("linux", "bsd", "mingw") then
         add_syslinks("m", "pthread")
         add_syslinks("m", "pthread")
     end
     end
 
 
@@ -117,6 +117,9 @@ package("protobuf-cpp")
         if version:ge("26.1") then
         if version:ge("26.1") then
             io.replace("cmake/abseil-cpp.cmake", "BUILD_SHARED_LIBS AND MSVC", "FALSE", {plain = true})
             io.replace("cmake/abseil-cpp.cmake", "BUILD_SHARED_LIBS AND MSVC", "FALSE", {plain = true})
         end
         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 = {
         local configs = {
             "-Dprotobuf_BUILD_TESTS=OFF",
             "-Dprotobuf_BUILD_TESTS=OFF",