xmake.lua 997 B

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