xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("enkits")
  2. set_homepage("https://github.com/dougbinks/enkiTS")
  3. set_description("A permissively licensed C and C++ Task Scheduler for creating parallel programs.")
  4. set_license("zlib")
  5. add_urls("https://github.com/dougbinks/enkiTS/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/dougbinks/enkiTS.git")
  7. add_versions("v1.10", "578f285fc7c2744bf831548f35b855c6ab06c0d541d08c9cc50b6b72a250811a")
  8. add_deps("cmake")
  9. add_linkdirs("lib/enkiTS")
  10. add_links("enkiTS")
  11. if is_plat("linux") then
  12. add_syslinks("pthread", "rt")
  13. end
  14. on_load("windows", function (package)
  15. if package:config("shared") then
  16. package:add("defines", "ENKITS_DLL")
  17. end
  18. end)
  19. on_install("windows", "macosx", "linux", function (package)
  20. local configs = {"-DENKITS_BUILD_EXAMPLES=OFF", "-DENKITS_INSTALL=ON"}
  21. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  22. table.insert(configs, "-DENKITS_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
  23. import("package.tools.cmake").install(package, configs)
  24. end)
  25. on_test(function (package)
  26. assert(package:check_cxxsnippets([[
  27. void test() {
  28. enki::TaskScheduler g_TS;
  29. g_TS.Initialize();
  30. }
  31. ]], {configs = {languages = "c++17"}, includes = "enkiTS/TaskScheduler.h"}))
  32. end)