xmake.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. package("uvw")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/skypjack/uvw")
  4. set_description("Header-only, event based, tiny and easy to use libuv wrapper in modern C++")
  5. add_urls("https://github.com/skypjack/uvw.git")
  6. add_versions("2.10.0", "v2.10.0_libuv_v1.42")
  7. add_deps("cmake", "libuv")
  8. on_install("macosx", "linux", "iphoneos", "android@linux,macosx", "mingw@linux,macosx", "windows", function (package)
  9. local configs = {}
  10. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  11. if package:config("shared") then
  12. table.insert(configs, "-DBUILD_SHARED_LIBS=on")
  13. else
  14. table.insert(configs, "-DBUILD_SHARED_LIBS=off")
  15. end
  16. import("package.tools.cmake").install(package, configs)
  17. end)
  18. on_test(function (package)
  19. assert(package:check_cxxsnippets({
  20. test = [[
  21. #include <uvw.hpp>
  22. void test() {
  23. auto loop = uvw::Loop::getDefault();
  24. }
  25. ]]},
  26. {configs = {languages = "c++17"}
  27. }))
  28. end)