2
0
Эх сурвалжийг харах

improve mingw for curl (#1522)

* improve mingw for curl

* fix mingw
ruki 3 жил өмнө
parent
commit
32d17d039b

+ 5 - 8
packages/l/libcurl/xmake.lua

@@ -65,7 +65,7 @@ package("libcurl")
         end
     end)
 
-    on_install("windows", "mingw@windows", function (package)
+    on_install("windows", "mingw", function (package)
         local configs = {"-DBUILD_TESTING=OFF", "-DENABLE_MANUAL=OFF"}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
@@ -87,10 +87,13 @@ package("libcurl")
         if package:is_plat("windows") then
             table.insert(configs, "-DCURL_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
         end
+        if package:is_plat("mingw") and version:le("7.85.0") then
+            io.replace("src/CMakeLists.txt", 'COMMAND ${CMAKE_COMMAND} -E echo "/* built-in manual is disabled, blank function */" > tool_hugehelp.c', "", {plain = true})
+        end
         import("package.tools.cmake").install(package, configs)
     end)
 
-    on_install("macosx", "linux", "iphoneos", "mingw@macosx", "cross", function (package)
+    on_install("macosx", "linux", "iphoneos", "cross", function (package)
         local configs = {"--disable-silent-rules",
                          "--disable-dependency-tracking",
                          "--without-hyper",
@@ -104,15 +107,9 @@ package("libcurl")
         if package:debug() then
             table.insert(configs, "--enable-debug")
         end
-        if package:config("pic") ~= false then
-            table.insert(configs, "--with-pic")
-        end
         if package:is_plat("macosx", "iphoneos") then
             table.insert(configs, (package:version():ge("7.77") and "--with-secure-transport" or "--with-darwinssl"))
         end
-        if package:is_plat("mingw") then
-            table.insert(configs, "--with-schannel")
-        end
         for _, name in ipairs({"openssl", "mbedtls", "zlib", "brotli", "zstd", "libssh2", "libidn2", "libpsl", "nghttp2"}) do
             table.insert(configs, package:config(name) and "--with-" .. name or "--without-" .. name)
         end