From baad8ba4a813d4db43a21defb7f72030d5330137 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Sun, 8 Sep 2019 17:08:26 +0800 Subject: [PATCH 1/2] add cpp taskflow lib --- packages/t/taskflow/xmake.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/t/taskflow/xmake.lua diff --git a/packages/t/taskflow/xmake.lua b/packages/t/taskflow/xmake.lua new file mode 100644 index 000000000..31248217a --- /dev/null +++ b/packages/t/taskflow/xmake.lua @@ -0,0 +1,35 @@ +package("taskflow") + + set_homepage("https://cpp-taskflow.github.io/") + set_description("A fast C++ header-only library to help you quickly write parallel programs with complex task dependencies") + + set_urls("https://github.com/cpp-taskflow/cpp-taskflow/archive/v$(version).zip") + add_versions("2.2.0", "6b3c3b083e6e93a988cebc8bbf794a78f61904efab21f1e3a667b3cf60d58ca2") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + static void test(){ + tf::Executor executor; + tf::Taskflow taskflow; + std::vector range(10); + std::vector out(10); + std::iota(range.begin(), range.end(), 0); + std::iota(out.begin(), out.end(), 0); + taskflow.parallel_for(range.begin(), range.end(), [&] (const int i) { + out[i] = i; + }); + executor.run(taskflow).get(); + for (int i = 0; i < 10; i++) { + assert(out[i] == i); + } + } + ]]}, {configs = {languages = "c++1z"}, includes = "taskflow/taskflow.hpp"})) + end) + From 176a425635f58afc7703a831cb7044f3e231674c Mon Sep 17 00:00:00 2001 From: fasiondog Date: Sun, 8 Sep 2019 17:50:01 +0800 Subject: [PATCH 2/2] add cpp-taskflow lib --- packages/{t/taskflow => c/cpp-taskflow}/xmake.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename packages/{t/taskflow => c/cpp-taskflow}/xmake.lua (89%) diff --git a/packages/t/taskflow/xmake.lua b/packages/c/cpp-taskflow/xmake.lua similarity index 89% rename from packages/t/taskflow/xmake.lua rename to packages/c/cpp-taskflow/xmake.lua index 31248217a..b87b66557 100644 --- a/packages/t/taskflow/xmake.lua +++ b/packages/c/cpp-taskflow/xmake.lua @@ -1,9 +1,10 @@ -package("taskflow") +package("cpp-taskflow") set_homepage("https://cpp-taskflow.github.io/") set_description("A fast C++ header-only library to help you quickly write parallel programs with complex task dependencies") - set_urls("https://github.com/cpp-taskflow/cpp-taskflow/archive/v$(version).zip") + add_urls("https://github.com/cpp-taskflow/cpp-taskflow.git") + add_urls("https://github.com/cpp-taskflow/cpp-taskflow/archive/v$(version).zip") add_versions("2.2.0", "6b3c3b083e6e93a988cebc8bbf794a78f61904efab21f1e3a667b3cf60d58ca2") add_deps("cmake")