|
@@ -5,41 +5,21 @@ package("promise-cpp")
|
|
|
|
|
|
add_urls("https://github.com/xhawk18/promise-cpp/archive/refs/tags/$(version).tar.gz",
|
|
add_urls("https://github.com/xhawk18/promise-cpp/archive/refs/tags/$(version).tar.gz",
|
|
"https://github.com/xhawk18/promise-cpp.git")
|
|
"https://github.com/xhawk18/promise-cpp.git")
|
|
- add_versions("2.1.3", "831f5c7fb36a1f0adda408898038b428d4afe96e7028947be0f755c6851eec26")
|
|
|
|
|
|
|
|
- add_patches("2.1.3", path.join(os.scriptdir(), "patches", "2.1.3", "cmake.patch"), "3ea274743d852c685e8a9fb4f609f768c2e5461061b87473092ee98c68e1ab88")
|
|
|
|
|
|
+ add_versions("2.1.5", "9608686d0d136323396a84c2f6046060a966ed10bf4bb7895ef87340c118b66a")
|
|
|
|
+ add_versions("2.1.3", "831f5c7fb36a1f0adda408898038b428d4afe96e7028947be0f755c6851eec26")
|
|
|
|
|
|
add_configs("boost_asio", { description = "Enable boost asio.", default = false, type = "boolean"})
|
|
add_configs("boost_asio", { description = "Enable boost asio.", default = false, type = "boolean"})
|
|
|
|
|
|
- add_deps("cmake")
|
|
|
|
- add_includedirs("include", "include/promise-cpp")
|
|
|
|
-
|
|
|
|
on_load(function (package)
|
|
on_load(function (package)
|
|
if package:config("boost_asio") then
|
|
if package:config("boost_asio") then
|
|
package:add("deps", "boost")
|
|
package:add("deps", "boost")
|
|
end
|
|
end
|
|
end)
|
|
end)
|
|
|
|
|
|
- on_install("linux", "macosx", "windows", function (package)
|
|
|
|
- local configs = {}
|
|
|
|
- table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
|
|
- table.insert(configs, "-DPROMISE_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
|
- import("package.tools.cmake").install(package, configs, {buildir = "build"})
|
|
|
|
- os.cp("include", package:installdir())
|
|
|
|
- os.cp("add_ons", package:installdir("include"))
|
|
|
|
- if package:is_plat("linux") then
|
|
|
|
- if package:config("shared") then
|
|
|
|
- os.cp("build/*.so", package:installdir("lib"))
|
|
|
|
- else
|
|
|
|
- os.cp("build/*.a", package:installdir("lib"))
|
|
|
|
- end
|
|
|
|
- elseif package:is_plat("macosx") then
|
|
|
|
- if package:config("shared") then
|
|
|
|
- os.cp("build/*.dylib", package:installdir("lib"))
|
|
|
|
- else
|
|
|
|
- os.cp("build/*.a", package:installdir("lib"))
|
|
|
|
- end
|
|
|
|
- end
|
|
|
|
|
|
+ on_install(function (package)
|
|
|
|
+ os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
|
|
|
|
+ import("package.tools.xmake").install(package, {boost_asio = package:config("boost_asio")})
|
|
end)
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
on_test(function (package)
|
|
@@ -86,4 +66,3 @@ package("promise-cpp")
|
|
assert(package:has_cxxtypes("promise::Promise", {configs = {languages = "c++14"}, includes = "promise-cpp/promise.hpp"}))
|
|
assert(package:has_cxxtypes("promise::Promise", {configs = {languages = "c++14"}, includes = "promise-cpp/promise.hpp"}))
|
|
end
|
|
end
|
|
end)
|
|
end)
|
|
-
|
|
|