xmake.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package("cello")
  2. set_homepage("http://libcello.org/")
  3. set_description("Higher level programming in C")
  4. add_urls("https://github.com/orangeduck/Cello/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/orangeduck/Cello.git")
  6. add_versions("2.1.0", "c138d974325fcb9640307c8b2d5dcc2d7127a1ccc5589d6c0794f86a5cb4001d")
  7. if is_plat("windows", "mingw") then
  8. add_syslinks("dbghelp")
  9. elseif is_plat("linux", "bsd") then
  10. add_syslinks("pthread")
  11. if is_plat("bsd") then
  12. add_syslinks("execinfo")
  13. end
  14. elseif is_plat("cross", "android", "wasm") then
  15. add_defines("CELLO_NSTRACE")
  16. end
  17. on_install("!wasm and (windows|!arm64 or !windows)", function(package)
  18. io.writefile("xmake.lua", [[
  19. add_rules("mode.release", "mode.debug")
  20. target("cello")
  21. set_kind("$(kind)")
  22. add_files("src/*.c")
  23. add_headerfiles("include/Cello.h")
  24. add_includedirs("include")
  25. if is_plat("windows", "mingw") then
  26. add_syslinks("dbghelp")
  27. if is_plat("windows") and is_kind("shared") then
  28. add_rules("utils.symbols.export_all")
  29. end
  30. elseif is_plat("linux", "bsd") then
  31. add_syslinks("pthread")
  32. if is_plat("bsd") then
  33. add_syslinks("execinfo")
  34. end
  35. elseif is_plat("cross", "android", "wasm") then
  36. add_defines("CELLO_NSTRACE")
  37. end
  38. ]])
  39. import("package.tools.xmake").install(package)
  40. end)
  41. on_test(function(package)
  42. assert(package:has_cfuncs("name", {includes = "Cello.h"}))
  43. end)