xmake.lua 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package("muduo")
  2. set_homepage("https://github.com/chenshuo/muduo")
  3. set_description("Event-driven network library for multi-threaded Linux server in C++11")
  4. add_urls("https://github.com/chenshuo/muduo.git")
  5. add_versions("2022.11.01", "f29ca0ebc2f3b0ab61c1be08482a5524334c3d6f")
  6. add_deps("cmake")
  7. add_deps("boost")
  8. on_install("linux", function (package)
  9. package:add("links", "muduo_net", "muduo_base")
  10. io.replace("CMakeLists.txt", "-Wold-style-cast", "", {plain = true})
  11. local configs ={"-DMUDUO_BUILD_EXAMPLES=OFF"}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. if package:is_arch("i386") then
  14. table.insert(configs, "-DCMAKE_BUILD_BITS=32")
  15. end
  16. import("package.tools.cmake").install(package, configs)
  17. end)
  18. on_test(function (package)
  19. assert(package:check_cxxsnippets({test = [[
  20. #include "muduo/net/EventLoop.h"
  21. void test() {
  22. muduo::net::EventLoop loop;
  23. }
  24. ]]}))
  25. end)