فهرست منبع

marl: add 2025.02.23 version (#8115)

* marl: add 2025.02.23 version

* fix mingw

* limit

* fix mingw
star9029 4 روز پیش
والد
کامیت
0affeeea45
1فایلهای تغییر یافته به همراه19 افزوده شده و 17 حذف شده
  1. 19 17
      packages/m/marl/xmake.lua

+ 19 - 17
packages/m/marl/xmake.lua

@@ -1,37 +1,39 @@
 package("marl")
-
     set_homepage("https://github.com/google/marl")
-    set_description("Marl is a hybrid thread / fiber task scheduler written in C++ 11.")
+    set_description("A hybrid thread / fiber task scheduler written in C++ 11")
+    set_license("Apache-2.0")
 
-    add_urls("https://github.com/google/marl.git")
+    add_urls("https://github.com/google/marl.git", {submodules = false})
 
-    add_versions("2021.8.18", "49602432d97222eec1e6c8e4f70723c3864c49c1")
-    add_versions("2022.3.02", "9929747c9ba6354691dbacaf14f9b35433871e5b")
+    add_versions("2025.02.23", "23bbc9bf0017ba75844d5be5b12b15c0134ca276")
 
     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")
+    on_install("!mingw or mingw|!i386", function (package)
+        if package:is_plat("windows") and package:config("shared") then
+            package:add("defines", "MARL_DLL=1")
         end
+
+        io.replace("CMakeLists.txt", "POSITION_INDEPENDENT_CODE 1", "", {plain = true})
+        -- https://github.com/google/marl/pull/234
+        io.replace("src/scheduler.cpp", "#if defined(_WIN32)", "#if defined(_MSC_VER)", {plain = true})
+
+        local configs = {"-DMARL_INSTALL=ON"}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
+        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        table.insert(configs, "-DMARL_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
+        table.insert(configs, "-DMARL_ASAN=" .. (package:config("asan") and "ON" or "OFF"))
         import("package.tools.cmake").install(package, configs)
     end)
 
     on_test(function (package)
-        assert(package:check_cxxsnippets({
-            test = [[
+        assert(package:check_cxxsnippets({test = [[
             #include <marl/scheduler.h>
             void test() {
                 marl::Scheduler scheduler(marl::Scheduler::Config::allCores());
             }
-            ]]},
-            {configs = {languages = "c++17"}
-        }))
+        ]]}, {configs = {languages = "c++11"}}))
     end)