From 32d17d039b5da34bb7cb6e73585196a62c1e9ed7 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 12 Oct 2022 11:03:41 +0800 Subject: [PATCH] improve mingw for curl (#1522) * improve mingw for curl * fix mingw --- packages/l/libcurl/xmake.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/l/libcurl/xmake.lua b/packages/l/libcurl/xmake.lua index b1c9d0cab..e30ad5820 100644 --- a/packages/l/libcurl/xmake.lua +++ b/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