瀏覽代碼

protobuf-cpp: remove non-host protoc (#5960)

star9029 7 月之前
父節點
當前提交
b0a7b31b13
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      packages/p/protobuf-cpp/xmake.lua

+ 7 - 3
packages/p/protobuf-cpp/xmake.lua

@@ -52,13 +52,13 @@ package("protobuf-cpp")
             package:add("deps", "ninja")
             package:set("policy", "package.cmake_generator.ninja", true)
         end
-    
+
         if package:is_plat("windows") then
             package:add("links", "libprotoc", "libprotobuf", "utf8_range", "utf8_validity")
         else
             package:add("links", "protoc", "protobuf", "utf8_range", "utf8_validity")
         end
-    
+
         if package:is_plat("linux", "bsd", "mingw") then
             package:add("syslinks", "m", "pthread")
         end
@@ -167,7 +167,11 @@ package("protobuf-cpp")
         end
         import("package.tools.cmake").install(package, configs, opt)
 
-        os.trycp("build/Release/protoc.exe", package:installdir("bin"))
+        if package:is_cross() then
+            os.tryrm(package:installdir("bin/*"))
+        else
+            os.trycp("build/Release/protoc.exe", package:installdir("bin"))
+        end
     end)
 
     on_test(function (package)