xmake.lua 918 B

123456789101112131415161718192021222324
  1. package("ricab-scope_guard")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://ricab.github.io/scope_guard/")
  4. set_description("A modern C++ scope guard that is easy to use but hard to misuse.")
  5. set_license("Unlicense")
  6. add_urls("https://github.com/ricab/scope_guard/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/ricab/scope_guard.git")
  8. add_versions("v1.1.0", "ddaf22ccd07e59af4698e2b9f912171adb664dc88f34b317f39dde3b88de4507")
  9. on_install(function (package)
  10. os.cp("scope_guard.hpp", package:installdir("include"))
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. #include <scope_guard.hpp>
  15. void my_callback() {}
  16. void test() {
  17. auto guard = sg::make_scope_guard(my_callback);
  18. }
  19. ]]}, {configs = {languages = "c++11"}}))
  20. end)