From f02647cf951f0aef5bc5baf102f19e49fecccda8 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Sat, 7 Sep 2019 16:27:26 +0800 Subject: [PATCH] add concurrentqueue --- packages/c/concurrentqueue/xmake.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/c/concurrentqueue/xmake.lua diff --git a/packages/c/concurrentqueue/xmake.lua b/packages/c/concurrentqueue/xmake.lua new file mode 100644 index 000000000..bb7e8c89b --- /dev/null +++ b/packages/c/concurrentqueue/xmake.lua @@ -0,0 +1,24 @@ +package("concurrentqueue") + + set_homepage("https://github.com/cameron314/concurrentqueue") + set_description("An industrial-strength lock-free queue for C++.") + + add_urls("https://github.com/cameron314/concurrentqueue.git") + + on_install(function (package) + os.cp("*.h", package:installdir("include/concurrentqueue")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + static void test() { + moodycamel::ConcurrentQueue q; + bool success = q.enqueue(25); + int item; + bool found = q.try_dequeue(item); + assert(found && item == 25); + } + ]]}, {configs = {languages = "c++11"}, includes = "concurrentqueue/concurrentqueue.h"})) + end) +