xmake.lua 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. package("libaco")
  2. set_homepage("https://github.com/hnes/libaco")
  3. set_description("A blazing fast and lightweight C asymmetric coroutine library")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/hnes/libaco/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/hnes/libaco.git")
  7. add_versions("v1.2.4", "25e0777ec2c686cc8c8433537d9b3694d196b0287abe6df4f0c21f8605fa5a06")
  8. on_install("macosx", "linux", function (package)
  9. io.writefile("xmake.lua", [[
  10. add_rules("mode.debug", "mode.release")
  11. target("libaco")
  12. set_kind("$(kind)")
  13. add_files("acosw.S")
  14. add_headerfiles("aco.h")
  15. add_files("aco.c")
  16. ]])
  17. local configs = {}
  18. if package:config("shared") then
  19. configs.kind = "shared"
  20. end
  21. import("package.tools.xmake").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cfuncs("aco_resume", {includes = "aco.h"}))
  25. end)