xmake.lua 1003 B

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