xmake.lua 1022 B

1234567891011121314151617181920212223242526
  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.2.3", "583fe281c3b83f403b7fb18389e64bacc3ca0b30683d550f2ad6159cc0ebb6be")
  8. add_versions("v1.1.1", "49b20cbc0e5d9f94bcdc96056f8c5d91ee2e45d8642e02cb37e511079671ad48")
  9. on_install("linux", function (package)
  10. os.cp("reflect", package:installdir("include"))
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. #include <reflect>
  15. enum E { A, B };
  16. struct foo { int a; E b; };
  17. void test() {
  18. constexpr auto f = foo{.a = 42, .b = B};
  19. static_assert(2 == reflect::size(f));
  20. }
  21. ]]}, {configs = {languages = "c++20"}}))
  22. end)