Browse Source

libgit2: tune syslinks on windows (#3061)

Darcy Shen 1 year ago
parent
commit
32a23db41d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      packages/l/libgit2/xmake.lua

+ 4 - 2
packages/l/libgit2/xmake.lua

@@ -20,7 +20,7 @@ package("libgit2")
         add_deps("pcre")
         add_deps("pcre")
         add_syslinks("pthread", "dl")
         add_syslinks("pthread", "dl")
     elseif is_plat("windows") then
     elseif is_plat("windows") then
-        add_syslinks("ole32", "rpcrt4", "winhttp")
+        add_syslinks("ole32", "rpcrt4", "winhttp", "ws2_32", "user32", "crypt32", "advapi32")
     end
     end
 
 
     on_install("macosx", "linux", "windows|x64", "windows|x86", "iphoneos", function (package)
     on_install("macosx", "linux", "windows|x64", "windows|x86", "iphoneos", function (package)
@@ -41,7 +41,9 @@ package("libgit2")
                 table.insert(configs, "-DSTATIC_CRT=OFF")
                 table.insert(configs, "-DSTATIC_CRT=OFF")
             end
             end
             io.replace("CMakeLists.txt", "/GL", "", {plain = true})
             io.replace("CMakeLists.txt", "/GL", "", {plain = true})
-            io.replace("cmake/DefaultCFlags.cmake", "/GL", "", {plain = true}) -- for 1.7.1
+            if package:version():eq("1.7.1") then
+                io.replace("cmake/DefaultCFlags.cmake", "/GL", "", {plain = true})
+            end
         end
         end
         import("package.tools.cmake").install(package, configs)
         import("package.tools.cmake").install(package, configs)
     end)
     end)