xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("osmanip")
  2. set_homepage("https://github.com/JustWhit3/osmanip")
  3. set_description("A cross-platform library for output stream manipulation using ANSI escape sequences.")
  4. set_license("MIT")
  5. add_urls("https://github.com/JustWhit3/osmanip/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/JustWhit3/osmanip.git")
  7. add_versions("v4.6.1", "5454cb0caced1fb9af90666001f2874786a33e6830024cb41c99a5b4ab966f1c")
  8. add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true})
  9. if is_plat("linux") then
  10. add_syslinks("pthread")
  11. end
  12. add_deps("cmake")
  13. on_install(function (package)
  14. local configs = {"-DOSMANIP_TESTS=OFF"}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  17. io.replace("CMakeLists.txt", "add_subdirectory( deps )", "", {plain = true})
  18. io.replace("CMakeLists.txt", "add_subdirectory( examples )", "", {plain = true})
  19. import("package.tools.cmake").install(package, configs)
  20. end)
  21. on_test(function (package)
  22. assert(package:check_cxxsnippets({test = [[
  23. #include <osmanip/utility/options.hpp>
  24. void test() {
  25. osm::OPTION(osm::CURSOR::OFF);
  26. }
  27. ]]}, {configs = {languages = "c++17"}}))
  28. end)