xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("bytepack")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/farukeryilmaz/bytepack")
  4. set_description("C++ Binary Serialization Made Easy: Header-only, configurable endianness, cross-platform, no IDL, no exceptions, and no macros")
  5. set_license("MIT")
  6. add_urls("https://github.com/farukeryilmaz/bytepack/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/farukeryilmaz/bytepack.git")
  8. add_versions("v0.1.0", "7761cf51736d4e1a65ca69323182930967846eaed04adddfd316f59a5c2eb244")
  9. on_check(function (package)
  10. assert(package:check_cxxsnippets({test = [[
  11. #include <algorithm>
  12. #include <string>
  13. void test() {
  14. std::string s{"xmake"};
  15. std::ranges::reverse(s.begin(), s.end());
  16. }
  17. ]]}, {configs = {languages = "c++20"}}), "package(bytepack) Require at least C++20.")
  18. end)
  19. on_install(function (package)
  20. os.cp("include", package:installdir())
  21. end)
  22. on_test(function (package)
  23. assert(package:check_cxxsnippets({test = [[
  24. #include <bytepack/bytepack.hpp>
  25. void test() {
  26. bytepack::binary_stream serializationStream(64);
  27. }
  28. ]]}, {configs = {languages = "c++20"}}))
  29. end)