Skip to content

Commit

Permalink
Auto-update promise-cpp to 2.1.5 (#4106)
Browse files Browse the repository at this point in the history
* Update promise-cpp to 2.1.5

* port

* fix shared

---------

Co-authored-by: star9029 <[email protected]>
  • Loading branch information
waruqi and star-hengxing committed May 23, 2024
1 parent 761483e commit 61fac16
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 98 deletions.
72 changes: 0 additions & 72 deletions packages/p/promise-cpp/patches/2.1.3/cmake.patch

This file was deleted.

19 changes: 19 additions & 0 deletions packages/p/promise-cpp/port/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
option("boost_asio", {showmenu = true, default = false})

add_rules("mode.debug", "mode.release")
set_languages("c++11")

if has_config("boost_asio") then
add_requires("boost")
add_packages("boost")
end

target("promise-cpp")
set_kind("$(kind)")
add_files("src/*.cpp")
add_includedirs(".", "include")
add_headerfiles("include/(**.hpp)", "(add_ons/**.hpp)")

if is_plat("windows") and is_kind("shared") then
add_defines("PROMISE_BUILD_SHARED")
end
31 changes: 5 additions & 26 deletions packages/p/promise-cpp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,21 @@ package("promise-cpp")

add_urls("https://github.com/xhawk18/promise-cpp/archive/refs/tags/$(version).tar.gz",
"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_deps("cmake")
add_includedirs("include", "include/promise-cpp")

on_load(function (package)
if package:config("boost_asio") then
package:add("deps", "boost")
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)

on_test(function (package)
Expand Down Expand Up @@ -86,4 +66,3 @@ package("promise-cpp")
assert(package:has_cxxtypes("promise::Promise", {configs = {languages = "c++14"}, includes = "promise-cpp/promise.hpp"}))
end
end)

0 comments on commit 61fac16

Please sign in to comment.