xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728
  1. package("asio2")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/zhllxt/asio2")
  4. set_description("Header only c++ network library, based on asio, support tcp,udp,http,websocket,rpc,ssl,icmp,serial_port.")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/zhllxt/asio2/archive/refs/tags/$(version).zip",
  7. "https://github.com/zhllxt/asio2.git")
  8. add_versions("v2.9", "3ce0b41300954ffc13948bd51af6430e324b1c28e26d2eb5a83e775cf38c12b4")
  9. add_patches("2.9", "patches/2.9/remove-const.patch", "6326f333ab2d0484c23bb3cd9cfd5a565030b5525d083677565a693f5f8803b6")
  10. add_deps("asio", "cereal", "fmt", "openssl3")
  11. add_deps("spdlog", { configs = { header_only = false, fmt_external = true } })
  12. on_install("windows", "linux", "macosx", "mingw", "bsd", "cross", function (package)
  13. os.cp(path.join("include", "*"), package:installdir("include"))
  14. end)
  15. on_test(function (package)
  16. assert(package:check_cxxsnippets({test = [[
  17. #include <asio2/asio2.hpp>
  18. void test() {
  19. asio2::tcp_server server;
  20. }
  21. ]]}, {configs = {languages = "c++17"}}))
  22. end)