Skip to content

Commit 3b4fd49

Browse files
gibbz00luadebug
andauthored
oneshot: add package (#8617)
* oneshot: add package * Drop wasm support --------- Co-authored-by: Saikari <lin@sz.cn.eu.org>
1 parent 0374f64 commit 3b4fd49

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

packages/o/oneshot/xmake.lua

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package("oneshot")
2+
set_kind("library", {headeronly = true})
3+
set_homepage("https://github.com/ashtum/oneshot")
4+
set_description("A single-header scheduler aware C++ oneshot channel.")
5+
set_license("BSL-1.0")
6+
7+
add_urls("https://github.com/ashtum/oneshot.git")
8+
9+
add_versions("2025.11.14", "57ab00d924d6436e3ee649be1a14a349fb52a8d0")
10+
11+
add_configs("asio_standalone", {description = "Use standalone asio.", default = false, type = "boolean"})
12+
13+
on_load(function (package)
14+
if package:config("asio_standalone") then
15+
package:add("defines", "ONESHOT_ASIO_STANDALONE")
16+
package:add("deps", "asio")
17+
else
18+
package:add("deps", "boost", {configs = {asio = true}})
19+
end
20+
end)
21+
22+
on_install("!wasm", function (package)
23+
os.cp("include", package:installdir())
24+
end)
25+
26+
on_test(function (package)
27+
assert(package:check_cxxsnippets({test = [[
28+
#include <oneshot.hpp>
29+
void test() {
30+
auto [sender, receiver] = oneshot::create<std::string>();
31+
}
32+
]]}, {configs = {languages = "cxx17"}}))
33+
end)

0 commit comments

Comments
 (0)