xmake.lua 927 B

12345678910111213141516171819202122232425
  1. package("boost_reflect")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/boost-ext/reflect")
  4. set_description("C++20 static reflection library")
  5. add_urls("https://github.com/boost-ext/reflect/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/boost-ext/reflect.git")
  7. add_versions("v1.1.1", "49b20cbc0e5d9f94bcdc96056f8c5d91ee2e45d8642e02cb37e511079671ad48")
  8. on_install("linux", function (package)
  9. os.cp("reflect", package:installdir("include"))
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. #include <reflect>
  14. enum E { A, B };
  15. struct foo { int a; E b; };
  16. void test() {
  17. constexpr auto f = foo{.a = 42, .b = B};
  18. static_assert(2 == reflect::size(f));
  19. }
  20. ]]}, {configs = {languages = "c++20"}}))
  21. end)