xmake.lua 1.0 KB

1234567891011121314151617181920212223242526
  1. package("asio3")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/zhllxt/asio3")
  4. set_description("Header only c++ network library, based on c++ 20 coroutine and asio")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/zhllxt/asio3.git")
  7. add_versions("2023.12.03", "66e76da69b359540fdf15b85bd5f3612b358c1da")
  8. add_deps("asio", "cereal", "fmt", "openssl3", "nlohmann_json")
  9. add_deps("spdlog", { configs = { header_only = false, fmt_external = true } })
  10. on_install("windows", "linux", "macosx", "mingw", "bsd", function (package)
  11. os.cp(path.join("include"), package:installdir())
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. #include <asio3/tcp/tcp_client.hpp>
  16. namespace net = ::asio;
  17. void test() {
  18. net::io_context ctx;
  19. net::tcp_client client(ctx.get_executor());
  20. }
  21. ]]}, {configs = {languages = "c++23"}}))
  22. end)