xmake.lua 997 B

1234567891011121314151617181920212223242526
  1. package("boost_pfr")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/boostorg/pfr")
  4. set_description("C++14 library for struct reflection")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/boostorg/pfr/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/boostorg/pfr.git")
  8. add_versions("2.2.0", "6f490ec1383de5855dcf801c23f0a967f888eb6e1440b6ca0bf36c12d4ae7ac7")
  9. add_versions("2.1.0", "7c18a4ab73b70f8b3513fa3a836c6f4310f627bbf55f62b89bdd7aa787c7da31")
  10. on_install(function (package)
  11. os.cp("include", package:installdir())
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. #include <boost/pfr.hpp>
  16. struct foo { int a; float b; };
  17. void test() {
  18. foo f{1, 2.0f};
  19. boost::pfr::for_each_field(f, [](auto&& field) { field += 1; });
  20. }
  21. ]]}, {configs = {languages = "c++14"}}))
  22. end)