xmake.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package("asio")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("http://think-async.com/Asio/")
  4. set_description("Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach.")
  5. set_license("BSL-1.0")
  6. add_urls("https://sourceforge.net/projects/asio/files/asio/$(version) (Stable)/asio-$(version).tar.gz", {alias = "sourceforge"})
  7. add_urls("https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-$(version).tar.gz", {alias = "github", version = function (version) return version:gsub("%.", "-") end})
  8. add_versions("github:1.34.2", "f3bac015305fbb700545bd2959fbc52d75a1ec2e05f9c7f695801273ceb78cf5")
  9. add_versions("github:1.34.0", "061ed6c8b97527756aed3e34d2cbcbcb6d3c80afd26ed6304f51119e1ef6a1cd")
  10. add_versions("github:1.32.0", "f1b94b80eeb00bb63a3c8cef5047d4e409df4d8a3fe502305976965827d95672")
  11. add_versions("github:1.30.2", "755bd7f85a4b269c67ae0ea254907c078d408cce8e1a352ad2ed664d233780e8")
  12. add_versions("github:1.29.0", "44305859b4e6664dbbf853c1ef8ca0259d694f033753ae309fcb2534ca20f721")
  13. add_versions("github:1.28.0", "226438b0798099ad2a202563a83571ce06dd13b570d8fded4840dbc1f97fa328")
  14. add_versions("github:1.24.0", "cbcaaba0f66722787b1a7c33afe1befb3a012b5af3ad7da7ff0f6b8c9b7a8a5b")
  15. add_versions("github:1.21.0", "5d2d2dcb7bfb39bff941cabbfc8c27ee322a495470bf0f3a7c5238648cf5e6a9")
  16. add_versions("sourceforge:1.20.0", "4cd5cd0ad97e752a4075f02778732a3737b587f5eeefab59cd98dc43b0dcadb3")
  17. add_versions("github:1.20.0", "34a8f07be6f54e3753874d46ecfa9b7ab7051c4e3f67103c52a33dfddaea48e6")
  18. if is_plat("mingw") then
  19. add_syslinks("ws2_32", "bcrypt")
  20. end
  21. on_install("!wasm", function (package)
  22. if os.isdir("asio") then
  23. os.cp("asio/include/asio.hpp", package:installdir("include"))
  24. os.cp("asio/include/asio", package:installdir("include"))
  25. else
  26. os.cp("include/asio.hpp", package:installdir("include"))
  27. os.cp("include/asio", package:installdir("include"))
  28. end
  29. end)
  30. on_test(function (package)
  31. assert(package:check_cxxsnippets({test = [[
  32. void test() {
  33. asio::io_context io_context;
  34. asio::steady_timer timer(io_context);
  35. timer.expires_at(asio::steady_timer::clock_type::time_point::min());
  36. }
  37. ]]}, {configs = {languages = "c++14"}, includes = "asio.hpp"}))
  38. end)