xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("flecs")
  2. set_homepage("https://github.com/SanderMertens/flecs")
  3. set_description("A fast entity component system (ECS) for C & C++")
  4. set_license("MIT")
  5. add_urls("https://github.com/SanderMertens/flecs/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/SanderMertens/flecs.git")
  7. add_versions("v3.0.0", "ae88da6abc5612d16ab2e6aa4041b035491fc1f2")
  8. add_versions("v2.4.8", "9a8040a197e4b5e032524bc7183f68faa7b2f759c67b983b40018a7726561cac")
  9. add_deps("cmake")
  10. if is_plat("linux") then
  11. add_syslinks("pthread")
  12. end
  13. on_install("windows", "macosx", "linux", function (package)
  14. local configs = {}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DFLECS_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON"))
  17. table.insert(configs, "-DFLECS_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  18. if package:is_plat("windows") and not package:config("shared") then
  19. package:add("defines", "flecs_STATIC")
  20. end
  21. import("package.tools.cmake").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:check_cxxsnippets({test = [[
  25. void test() {
  26. flecs::world ecs;
  27. }
  28. ]]}, {configs = {languages = "c++14"}, includes = "flecs.h"}))
  29. end)