xmake.lua 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package("alpaca")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/p-ranav/alpaca")
  4. set_description("Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code")
  5. set_license("MIT")
  6. add_urls("https://github.com/p-ranav/alpaca/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/p-ranav/alpaca.git", {submodules = false})
  8. -- 2024.07.20
  9. add_versions("v0.2.1", "ea5ab2aaa97be20d48c0ce99eb90321f1db91929")
  10. add_deps("cmake")
  11. on_install("!wasm and !bsd", function (package)
  12. import("package.tools.cmake").install(package)
  13. end)
  14. on_test(function (package)
  15. assert(package:check_cxxsnippets({test = [[
  16. struct Config {
  17. std::string device;
  18. };
  19. void test() {
  20. Config c{"/dev/video0"};
  21. std::vector<uint8_t> bytes;
  22. auto bytes_written = alpaca::serialize(c, bytes);
  23. }
  24. ]]}, {configs = {languages = "c++17"}, includes = "alpaca/alpaca.h"}))
  25. end)