Skip to content

Commit

Permalink
Fix build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tindy2013 committed Dec 10, 2023
1 parent 8485c2c commit a4a273d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
8 changes: 4 additions & 4 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ includes("xmake/curl-static.lua")
add_requires("libcron", {system = false})
add_requires("yaml-cpp-static", {system = false})
add_requires("quickjspp", {system = false})
if not is_plat("macosx") and has_config("static") then
if not is_plat("macosx") and get_config("static") == true then
add_requires("curl-static", {system = false})
else
add_requires("libcurl")
Expand All @@ -33,10 +33,10 @@ target("subconverter")
add_includedirs("src")
add_includedirs("include")
add_packages("pcre2", "rapidjson", "toml11", "libcron", "quickjspp")
if is_plat("macosx") then
add_packages("libcurl")
else
if not is_plat("macosx") and get_config("static") == true then
add_packages("curl-static")
else
add_packages("libcurl")
end
if has_config("static") then
add_packages("yaml-cpp-static")
Expand Down
13 changes: 12 additions & 1 deletion xmake/curl-static.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ package("curl-static")
add_deps("cmake")
add_versions("8.5.0", "7161cb17c01dcff1dc5bf89a18437d9d729f1ecd")
set_urls("https://github.com/curl/curl.git")

if is_plat("macosx", "iphoneos") then
add_frameworks("Security", "CoreFoundation", "SystemConfiguration")
elseif is_plat("linux") then
add_deps("mbedtls")
add_syslinks("pthread")
elseif is_plat("windows", "mingw") then
add_deps("zlib")
add_syslinks("advapi32", "crypt32", "wldap32", "winmm", "ws2_32", "user32", "bcrypt")
end

on_install(function (package)
local configs = {}
table.insert(configs, "-DCURL_USE_LIBSSH2=OFF")
Expand All @@ -14,7 +25,7 @@ package("curl-static")
table.insert(configs, "-DHTTP_ONLY=ON")
table.insert(configs, "-DCURL_USE_LIBSSH2=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"))
table.insert(configs, "-DBUILD_SHARED_LIBS=OFF")
import("package.tools.cmake").install(package, configs)
end)
package_end()

0 comments on commit a4a273d

Please sign in to comment.