xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. package("c-vector")
  2. set_homepage("https://github.com/Mashpoe/c-vector")
  3. set_description("A simple vector library for C that can store any type.")
  4. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/Mashpoe/c-vector/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/Mashpoe/c-vector.git")
  7. add_versions("v1.0", "c1ddd2975abd54ce55309fef04cc9d47e8a356a964298f516a9e314f9fcd20d4")
  8. on_install(function (package)
  9. local configs = {}
  10. io.writefile("xmake.lua", [[
  11. add_rules("mode.release", "mode.debug")
  12. target("c-vector")
  13. set_kind("$(kind)")
  14. add_files("vec.c")
  15. add_headerfiles("vec.h")
  16. if is_plat("windows") and is_kind("shared") then
  17. add_rules("utils.symbols.export_all")
  18. end
  19. ]])
  20. if package:config("shared") then
  21. configs.kind = "shared"
  22. end
  23. import("package.tools.xmake").install(package, configs)
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("vector_create", {includes = "vec.h"}))
  27. end)