Jelajahi Sumber

Add marl to xmake repo (#737)

* Add marl to xmake repo

* Update xmake.lua

* Update xmake.lua

Co-authored-by: ruki <[email protected]>
Kelvin Zhang 3 tahun lalu
induk
melakukan
bf5708e378
1 mengubah file dengan 36 tambahan dan 0 penghapusan
  1. 36 0
      packages/m/marl/xmake.lua

+ 36 - 0
packages/m/marl/xmake.lua

@@ -0,0 +1,36 @@
+package("marl")
+
+    set_homepage("https://github.com/google/marl")
+    set_description("Marl is a hybrid thread / fiber task scheduler written in C++ 11.")
+
+    add_urls("https://github.com/google/marl.git")
+
+    add_versions("2021.8.18", "49602432d97222eec1e6c8e4f70723c3864c49c1")
+
+    add_deps("cmake")
+    if is_plat("linux", "bsd") then
+        add_syslinks("pthread")
+    end
+
+    on_install("windows", "linux", "macosx", function (package)
+        local configs = {"-DMARL_INSTALL=on"}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+        if package:config("shared") then
+            table.insert(configs, "-DBUILD_SHARED_LIBS=on")
+        else
+            table.insert(configs, "-DBUILD_SHARED_LIBS=off")
+        end
+        import("package.tools.cmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({
+            test = [[
+            #include <marl/scheduler.h>
+            void test() {
+                marl::Scheduler scheduler(marl::Scheduler::Config::allCores());
+            }
+            ]]},
+            {configs = {languages = "c++17"}
+        }))
+    end)