Browse Source

libgit2: Support wasm (#6141)

star9029 9 months ago
parent
commit
9f5a6ed1cc
1 changed files with 3 additions and 17 deletions
  1. 3 17
      packages/l/libgit2/xmake.lua

+ 3 - 17
packages/l/libgit2/xmake.lua

@@ -16,7 +16,7 @@ package("libgit2")
 
 
     add_configs("ssh", {description = "Enable SSH support", default = false, type = "boolean"})
     add_configs("ssh", {description = "Enable SSH support", default = false, type = "boolean"})
     add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
     add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
-    add_configs("https", {description = "Select crypto backend.", default = (is_plat("windows", "mingw") and "winhttp" or "openssl"), type = "string", values = {"winhttp", "openssl", "mbedtls"}})
+    add_configs("https", {description = "Select crypto backend.", default = (is_plat("windows", "mingw") and "winhttp" or "openssl3"), type = "string", values = {"winhttp", "openssl3", "mbedtls"}})
 
 
     if is_plat("linux", "bsd") then
     if is_plat("linux", "bsd") then
         add_syslinks("pthread", "dl")
         add_syslinks("pthread", "dl")
@@ -56,11 +56,6 @@ package("libgit2")
 
 
     on_load(function (package)
     on_load(function (package)
         local https = package:config("https")
         local https = package:config("https")
-        if package:is_plat("iphoneos") and https == "openssl" then
-            -- TODO: openssl support iphoneos
-            return 
-        end
-
         if https ~= "winhttp" then
         if https ~= "winhttp" then
             package:add("deps", https)
             package:add("deps", https)
         end
         end
@@ -76,7 +71,7 @@ package("libgit2")
         end
         end
     end)
     end)
 
 
-    on_install("!wasm", function (package)
+    on_install(function (package)
         if package:is_plat("android") then
         if package:is_plat("android") then
             for _, file in ipairs(os.files("src/**.txt")) do
             for _, file in ipairs(os.files("src/**.txt")) do
                 if path.basename(file) == "CMakeLists" then
                 if path.basename(file) == "CMakeLists" then
@@ -130,11 +125,7 @@ package("libgit2")
         table.insert(configs, "-DUSE_SSH=" .. (package:config("ssh") and "ON" or "OFF"))
         table.insert(configs, "-DUSE_SSH=" .. (package:config("ssh") and "ON" or "OFF"))
         table.insert(configs, "-DBUILD_CLI=" .. (package:config("tools") and "ON" or "OFF"))
         table.insert(configs, "-DBUILD_CLI=" .. (package:config("tools") and "ON" or "OFF"))
 
 
-        if package:is_plat("windows") then
-            table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''")
-        elseif package:is_plat("iphoneos") and https == "openssl" then
-            table.insert(configs, "-DUSE_HTTPS=OFF")
-        elseif package:is_plat("mingw") then
+        if package:is_plat("mingw") then
             local mingw = import("detect.sdks.find_mingw")()
             local mingw = import("detect.sdks.find_mingw")()
             local dlltool = assert(os.files(path.join(mingw.bindir, "*dlltool*"))[1], "dlltool not found!")
             local dlltool = assert(os.files(path.join(mingw.bindir, "*dlltool*"))[1], "dlltool not found!")
             table.insert(configs, "-DDLLTOOL=" .. dlltool)
             table.insert(configs, "-DDLLTOOL=" .. dlltool)
@@ -146,11 +137,6 @@ package("libgit2")
             opt.cxflags = "-DPCRE2_STATIC"
             opt.cxflags = "-DPCRE2_STATIC"
         end
         end
         import("package.tools.cmake").install(package, configs, opt)
         import("package.tools.cmake").install(package, configs, opt)
-
-        if package:is_plat("windows") and package:is_debug() then
-            local dir = package:installdir(package:config("shared") and "bin" or "lib")
-            os.vcp(path.join(package:buildir(), "*.pdb"), dir)
-        end
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)