Skip to content

Commit

Permalink
Add cpp-async package (#4323)
Browse files Browse the repository at this point in the history
* cpp-async: add package

* Update xmake.lua

* add check

---------

Co-authored-by: star9029 <hengxings783@gmail.com>
  • Loading branch information
zziger and star-hengxing committed Jun 11, 2024
1 parent ae4240f commit 5a31cde
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/c/cpp-async/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package("cpp-async")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/microsoft/cpp-async")
set_description("Support types and functions for C++20 coroutines")
set_license("MIT")

add_urls("https://github.com/microsoft/cpp-async/archive/refs/tags/$(version).tar.gz",
"https://github.com/microsoft/cpp-async.git")

add_versions("v1.1.0", "168681dfd999b7546d623f20d18072ce280502cf0bf3a829c2aec58741062a23")

on_check(function (package)
assert(package:has_cxxincludes("coroutine", {configs = {languages = "c++20"}}), "package(cpp-async) Require at least C++20.")
end)

on_install(function (package)
os.cp("include/async", package:installdir("include"))
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <async/task.h>
#include <coroutine>
inline async::task<void> do_async()
{
co_return;
}
]]}, {configs = {languages = "c++20"}}))
end)

0 comments on commit 5a31cde

Please sign in to comment.