xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("marl")
  2. set_homepage("https://github.com/google/marl")
  3. set_description("Marl is a hybrid thread / fiber task scheduler written in C++ 11.")
  4. add_urls("https://github.com/google/marl.git")
  5. add_versions("2021.8.18", "49602432d97222eec1e6c8e4f70723c3864c49c1")
  6. add_versions("2022.3.02", "9929747c9ba6354691dbacaf14f9b35433871e5b")
  7. add_deps("cmake")
  8. if is_plat("linux", "bsd") then
  9. add_syslinks("pthread")
  10. end
  11. on_install("windows", "linux", "macosx", function (package)
  12. local configs = {"-DMARL_INSTALL=on"}
  13. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  14. if package:config("shared") then
  15. table.insert(configs, "-DBUILD_SHARED_LIBS=on")
  16. else
  17. table.insert(configs, "-DBUILD_SHARED_LIBS=off")
  18. end
  19. import("package.tools.cmake").install(package, configs)
  20. end)
  21. on_test(function (package)
  22. assert(package:check_cxxsnippets({
  23. test = [[
  24. #include <marl/scheduler.h>
  25. void test() {
  26. marl::Scheduler scheduler(marl::Scheduler::Config::allCores());
  27. }
  28. ]]},
  29. {configs = {languages = "c++17"}
  30. }))
  31. end)