Browse Source

improve protobuf-cpp for msvc

ruki 6 years ago
parent
commit
5de739eefa
1 changed files with 7 additions and 2 deletions
  1. 7 2
      packages/p/protobuf-cpp/xmake.lua

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

@@ -10,7 +10,11 @@ package("protobuf-cpp")
         add_deps("cmake")
         add_deps("cmake")
     end
     end
 
 
-    add_links("protobuf")
+    if is_plat("windows") then
+        add_links("libprotobuf")
+    else
+        add_links("protobuf")
+    end
 
 
     on_load(function (package)
     on_load(function (package)
         package:addenv("PATH", "bin")
         package:addenv("PATH", "bin")
@@ -18,7 +22,8 @@ package("protobuf-cpp")
 
 
     on_install("windows", function (package)
     on_install("windows", function (package)
         os.cd("cmake")
         os.cd("cmake")
-        import("package.tools.cmake").install(package)
+        import("package.tools.cmake").install(package, {"-Dprotobuf_BUILD_PROTOC_BINARIES=ON"})
+        os.cp("build_*/Release/protoc.exe", package:installdir("bin"))
     end)
     end)
 
 
     on_install("linux", "macosx", function (package)
     on_install("linux", "macosx", function (package)