Browse Source

Add tf_workstealingqueue (#3218)

* Add tf_workstealingqueue

* Fix tf_workstealingqueue
Jérôme Leclercq 1 year ago
parent
commit
01daa42daa
1 changed files with 26 additions and 0 deletions
  1. 26 0
      packages/t/tf_workstealingqueue/xmake.lua

+ 26 - 0
packages/t/tf_workstealingqueue/xmake.lua

@@ -0,0 +1,26 @@
+package("tf_workstealingqueue")
+    set_kind("library", {headeronly = true})
+    set_homepage("https://github.com/taskflow/work-stealing-queue")
+    set_description("A fast work-stealing queue template in C++")
+    set_license("MIT")
+
+    add_urls("https://github.com/taskflow/work-stealing-queue.git")
+    add_versions("2022.07.20", "378e297749374300bf9bc0229096285447993877")
+
+    on_install(function (package)
+        os.cp("wsq.hpp", package:installdir("include"))
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            static void test() {
+                WorkStealingQueue<int> queue;
+                queue.push(0);
+                queue.push(1);
+
+                std::optional<int> item1 = queue.pop();
+                std::optional<int> item2 = queue.steal();
+            }
+        ]]}, {configs = {languages = "c++17"}, includes = {"wsq.hpp"}}))
+    end)
+