Skip to content

Commit

Permalink
alpaca: add package (#5104)
Browse files Browse the repository at this point in the history
* alpaca: add package

* disable wasm

* disable bsd
  • Loading branch information
star-hengxing committed Aug 31, 2024
1 parent c3f50af commit bec7be4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/a/alpaca/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package("alpaca")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/p-ranav/alpaca")
set_description("Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code")
set_license("MIT")

add_urls("https://github.com/p-ranav/alpaca/archive/refs/tags/$(version).tar.gz",
"https://github.com/p-ranav/alpaca.git", {submodules = false})
-- 2024.07.20
add_versions("v0.2.1", "ea5ab2aaa97be20d48c0ce99eb90321f1db91929")

add_deps("cmake")

on_install("!wasm and !bsd", function (package)
import("package.tools.cmake").install(package)
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
struct Config {
std::string device;
};
void test() {
Config c{"/dev/video0"};
std::vector<uint8_t> bytes;
auto bytes_written = alpaca::serialize(c, bytes);
}
]]}, {configs = {languages = "c++17"}, includes = "alpaca/alpaca.h"}))
end)

0 comments on commit bec7be4

Please sign in to comment.