xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("pdcurses")
  2. set_homepage("https://pdcurses.org/")
  3. set_description("PDCurses - a curses library for environments that don't fit the termcap/terminfo model.")
  4. add_urls("https://github.com/wmcbrine/PDCurses/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/wmcbrine/PDCurses.git")
  6. add_versions("3.9", "590dbe0f5835f66992df096d3602d0271103f90cf8557a5d124f693c2b40d7ec")
  7. if not is_plat("windows") then
  8. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  9. end
  10. add_deps("libsdl")
  11. on_install("linux", "macosx", "mingw", "windows", function (package)
  12. io.writefile("xmake.lua", [[
  13. add_rules("mode.debug", "mode.release")
  14. add_requires("libsdl")
  15. target("pdcurses")
  16. set_kind("$(kind)")
  17. add_files("pdcurses/*.c", "sdl2/*.c")
  18. add_includedirs(".", "sdl2")
  19. add_headerfiles("*.h", "sdl2/*.h")
  20. add_packages("libsdl")
  21. ]])
  22. local configs = {}
  23. if package:config("shared") then
  24. configs.kind = "shared"
  25. end
  26. import("package.tools.xmake").install(package, configs)
  27. end)
  28. on_test(function (package)
  29. assert(package:has_cincludes("curses.h"))
  30. end)