|
@@ -3,10 +3,39 @@ package("co")
|
|
set_homepage("https://github.com/idealvin/co")
|
|
set_homepage("https://github.com/idealvin/co")
|
|
set_description("Yet another libco and more.")
|
|
set_description("Yet another libco and more.")
|
|
|
|
|
|
|
|
+-- add_urls("https://github.com/idealvin/co/archive/refs/tags/$(version).tar.gz")
|
|
add_urls("https://github.com/idealvin/co.git")
|
|
add_urls("https://github.com/idealvin/co.git")
|
|
|
|
|
|
|
|
+-- add_versions("v2.0.0", "1bf687ebc08f9951869a111c56b90898b2c320e988dc86355ce17368f279e44d")
|
|
|
|
+ add_versions("v2.0.0+1", "d962c6f77680cfc3337d1fc718f5ccda04210bd0")
|
|
|
|
+
|
|
|
|
+ if is_plat("windows") then
|
|
|
|
+ -- disable shared library
|
|
|
|
+ add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
|
|
|
|
+ end
|
|
|
|
+ for _, name in ipairs({"libcurl", "openssl"}) do
|
|
|
|
+ add_configs(name, {description = "Enable " .. name .. " library.", default = false, type = "boolean"})
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+ on_load(function (package)
|
|
|
|
+ for _, dep in ipairs({"libcurl", "openssl"}) do
|
|
|
|
+ if package:config(dep) then
|
|
|
|
+ package:add("deps", dep)
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ end)
|
|
|
|
+
|
|
on_install("macosx", "linux", "windows", function (package)
|
|
on_install("macosx", "linux", "windows", function (package)
|
|
- import("package.tools.xmake").install(package)
|
|
|
|
|
|
+ local configs = {}
|
|
|
|
+ if package:config("shared") then
|
|
|
|
+ configs.kind = "shared"
|
|
|
|
+ end
|
|
|
|
+ for _, name in ipairs({"libcurl", "openssl"}) do
|
|
|
|
+ if package:config(name) then
|
|
|
|
+ configs["with_" .. name] = true
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ import("package.tools.xmake").install(package, configs)
|
|
end)
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
on_test(function (package)
|