xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. package("brynet")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/IronsDu/brynet")
  4. set_description("A Header-Only cross-platform C++ TCP network library")
  5. set_license("MIT")
  6. add_urls("https://github.com/IronsDu/brynet/archive/337c9f375800b46da77116687a61c00ce534b60f.tar.gz",
  7. "https://github.com/IronsDu/brynet")
  8. add_versions("2024.06.03", "d35271b8f635959c6507c3bba24ff1ee121c6f27db177564012e54654e813ab8")
  9. add_configs("openssl", {description = "Enable openssl", default = false, type = "boolean"})
  10. on_load(function (package)
  11. if package:config("openssl") then
  12. package:add("deps", "openssl")
  13. package:add("defines", "BRYNET_USE_OPENSSL")
  14. end
  15. end)
  16. on_install("!wasm", function (package)
  17. os.cp("include", package:installdir())
  18. end)
  19. on_test(function (package)
  20. assert(package:check_cxxsnippets({test = [[
  21. void test() {
  22. auto service = brynet::net::IOThreadTcpService::Create();
  23. }
  24. ]]}, {configs = {languages = "c++17"}, includes = "brynet/net/TcpService.hpp"}))
  25. end)