xmake.lua 971 B

123456789101112131415161718192021222324252627
  1. package("linenoise")
  2. set_homepage("https://github.com/antirez/linenoise")
  3. set_description("A small self-contained alternative to readline and libedit")
  4. add_urls("https://github.com/antirez/linenoise.git")
  5. add_versions("2020.3.12", "97d2850af13c339369093b78abe5265845d78220")
  6. on_install("linux", "macosx", "bsd", "wasm", "android", "cross", "iphoneos", function (package)
  7. local configs = {}
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.release", "mode.debug")
  10. target("linenoise")
  11. set_kind("static")
  12. add_files("linenoise.c")
  13. add_headerfiles("linenoise.h")
  14. ]])
  15. if package:config("shared") then
  16. configs.kind = "shared"
  17. end
  18. import("package.tools.xmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:has_cfuncs("linenoise", {includes = {"stddef.h", "linenoise.h"}}))
  22. end)