xmake.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package("isocline")
  2. set_homepage("https://github.com/daanx/isocline")
  3. set_description("Isocline is a portable GNU readline alternative ")
  4. set_license("MIT")
  5. add_urls("https://github.com/daanx/isocline.git")
  6. add_versions("2022.01.16", "762717b5acc7d8baf64faeb5320ae4b85cf98aac")
  7. add_deps("cmake")
  8. on_install(function (package)
  9. io.replace("src/completers.c", "__finddata64_t", "_finddatai64_t", {plain = true})
  10. local configs = {}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  12. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  13. if package:is_plat("windows") and package:config("shared") then
  14. table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
  15. end
  16. import("package.tools.cmake").build(package, configs, {buildir = "build"})
  17. os.cp("include", package:installdir())
  18. os.trycp("build/**.a", package:installdir("lib"))
  19. os.trycp("build/**.dylib", package:installdir("lib"))
  20. os.trycp("build/**.so", package:installdir("lib"))
  21. os.trycp("build/**.lib", package:installdir("lib"))
  22. os.trycp("build/**.dll", package:installdir("bin"))
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. void test() {
  27. ic_set_history("history.txt", 100);
  28. }
  29. ]]}, {configs = {languages = "c++11"}, includes = "isocline.h"}))
  30. end)