xmake.lua 727 B

12345678910111213141516171819202122
  1. package("neargye-scope_guard")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/Neargye/scope_guard")
  4. set_description("Scope Guard & Defer C++")
  5. set_license("MIT")
  6. add_urls("https://github.com/Neargye/scope_guard.git")
  7. add_versions("2022.04.05", "fa60305b5805dcd872b3c60d0bc517c505f99502")
  8. on_install(function (package)
  9. os.cp("include", package:installdir())
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. #include <scope_guard.hpp>
  14. void test() {
  15. int* x = new int;
  16. SCOPE_EXIT{ delete x; };
  17. }
  18. ]]}, {configs = {languages = "c++11"}}))
  19. end)