From 42899977cb8fe0cc92b5efd30ae9283725edf882 Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 12 Nov 2024 19:10:30 +0800 Subject: [PATCH] zpp_bits: add package (#5740) * zpp_bits: add package * add check --- packages/z/zpp_bits/xmake.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/z/zpp_bits/xmake.lua diff --git a/packages/z/zpp_bits/xmake.lua b/packages/z/zpp_bits/xmake.lua new file mode 100644 index 000000000..6e90d144b --- /dev/null +++ b/packages/z/zpp_bits/xmake.lua @@ -0,0 +1,29 @@ +package("zpp_bits") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/eyalz800/zpp_bits") + set_description("A lightweight C++20 serialization and RPC library") + set_license("MIT") + + add_urls("https://github.com/eyalz800/zpp_bits/archive/refs/tags/$(version).tar.gz", + "https://github.com/eyalz800/zpp_bits.git") + + add_versions("v4.4.25", "d4afb8cf73aec19686928445e912dbbe8d39bffdac43ea69b4781f145195a09e") + + if on_check then + on_check("android", function (package) + local ndk = package:toolchain("ndk"):config("ndkver") + assert(ndk and tonumber(ndk) > 22, "package(zpp_bits) require ndk version > 22") + end) + end + + on_install(function (package) + os.vcp("zpp_bits.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + auto [data, in, out] = zpp::bits::data_in_out(); + } + ]]}, {configs = {languages = "c++20"}, includes = "zpp_bits.h"})) + end)