xmake.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package("watcher")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/e-dant/watcher")
  4. set_description("Filesystem watcher. Works anywhere. Simple, efficient and friendly.")
  5. set_license("MIT")
  6. set_urls("https://github.com/e-dant/watcher/archive/refs/tags/release/$(version).tar.gz",
  7. "https://github.com/e-dant/watcher.git")
  8. add_versions("0.13.5", "5bb0ea65b94d9444a6853eacff3a9b2121f0415d0ac895388d241f6f8be1e695")
  9. add_versions("0.13.2", "b037b4717a292892d61f619f9a2497ac0a49e8fd73d2c6bf4f9a6bef320718b2")
  10. add_versions("0.12.2", "1423b16734e588bce2a79e0ed205c8c2d651eea891b915862d7270873c72ca54")
  11. add_versions("0.11.0", "dd92496d77b6bc27e27ed28253faae4d81bc58b19407d154bb49504b2af73664")
  12. add_versions("0.9.5", "41b74d138eec106c35a99e7544def599453a8bf4cf4887ad627e1c9e3355287c")
  13. if is_plat("linux", "bsd") then
  14. add_syslinks("pthread")
  15. elseif is_plat("macosx") then
  16. add_frameworks("CoreFoundation", "CoreServices")
  17. end
  18. if on_check then
  19. on_check("android", function (package)
  20. if package:version() and package:version():ge("0.13.5") then
  21. local ndk = package:toolchain("ndk"):config("ndkver")
  22. assert(ndk and tonumber(ndk) > 22, "package(watcher >=0.13.5) require ndk version > 22")
  23. end
  24. end)
  25. end
  26. on_install("!wasm and !iphoneos and !bsd", function (package)
  27. os.cp("include", package:installdir())
  28. end)
  29. on_test(function (package)
  30. assert(package:check_cxxsnippets({test = [[
  31. #include <wtr/watcher.hpp>
  32. void test() {
  33. auto cb = [](wtr::event const& ev) {};
  34. auto watcher = wtr::watch(".", cb);
  35. }
  36. ]]}, {configs = {languages = "c++17"}}))
  37. end)