bytepack: add package (#3090)

* bytepack: add package

* add check
pull/4289/head
star9029 8 months ago committed by GitHub
parent fbdd11bfd2
commit e3a6987532
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 34
      packages/b/bytepack/xmake.lua

@ -0,0 +1,34 @@
package("bytepack")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/farukeryilmaz/bytepack")
set_description("C++ Binary Serialization Made Easy: Header-only, configurable endianness, cross-platform, no IDL, no exceptions, and no macros")
set_license("MIT")
add_urls("https://github.com/farukeryilmaz/bytepack/archive/refs/tags/$(version).tar.gz",
"https://github.com/farukeryilmaz/bytepack.git")
add_versions("v0.1.0", "7761cf51736d4e1a65ca69323182930967846eaed04adddfd316f59a5c2eb244")
on_check(function (package)
assert(package:check_cxxsnippets({test = [[
#include <algorithm>
#include <string>
void test() {
std::string s{"xmake"};
std::ranges::reverse(s.begin(), s.end());
}
]]}, {configs = {languages = "c++20"}}), "package(bytepack) Require at least C++20.")
end)
on_install(function (package)
os.cp("include", package:installdir())
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <bytepack/bytepack.hpp>
void test() {
bytepack::binary_stream serializationStream(64);
}
]]}, {configs = {languages = "c++20"}}))
end)
Loading…
Cancel
Save