xmake.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. package("out_ptr")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/soasis/out_ptr")
  4. set_description("Repository for a C++11 implementation of std::out_ptr (p1132), as a standalone library!")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/soasis/out_ptr.git")
  7. add_versions("2022.10.07", "c9190f7febbcfcb183e34fe8449bcea80efb28d2")
  8. on_install(function (package)
  9. os.cp("include/ztd", package:installdir("include"))
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. #include <memory>
  14. #include <ztd/out_ptr.hpp>
  15. struct S {};
  16. struct Deleter {
  17. void operator()(S*) {}
  18. };
  19. void withRawPtr(S**) {}
  20. void test() {
  21. std::unique_ptr<S, Deleter> ptr;
  22. withRawPtr(ztd::out_ptr::out_ptr(ptr));
  23. withRawPtr(ztd::out_ptr::inout_ptr(ptr));
  24. }
  25. ]]}, {configs = {languages = "cxx14"}}))
  26. end)