xmake.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package("emio")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://viatorus.github.io/emio/")
  4. set_description("A safe and fast high-level and low-level character input/output library for bare-metal and RTOS based embedded systems with a very small binary footprint.")
  5. add_urls("https://github.com/viatorus/emio/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/viatorus/emio.git")
  7. add_versions("0.8.0", "86436eeb16cac7c7c74a7c1af9fe7bbbc1aa18d3d96e7bba9791c15ebe9ebdc7")
  8. add_versions("0.7.0", "1ef5304964eee109c13477f2d84822ee474612475049a377b59e33a5fe05d7eb")
  9. add_versions("0.4.0", "847198a37fbf9dcc00ac85fbc64b283e41a018f53c39363129a4bdb9939338a6")
  10. add_deps("cmake")
  11. add_includedirs("include/emio")
  12. if on_check then
  13. on_check(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. #include <bit>
  16. void test() {
  17. for (unsigned x{0}; x != 8; ++x) {
  18. auto y = std::bit_width(x);
  19. }
  20. }
  21. ]]}, {configs = {languages = "c++20"}}), "package(emio) Require at least C++20.")
  22. end)
  23. end
  24. on_install("!windows", function (package)
  25. import("package.tools.cmake").install(package)
  26. end)
  27. on_test(function (package)
  28. assert(package:check_cxxsnippets({test = [[
  29. #include <emio/format.hpp>
  30. void test() {
  31. emio::format("{0}", 42);
  32. }
  33. ]]}, {configs = {languages = "c++20"}}))
  34. end)