From 55adb2193d2fe28d19514e7ad92f353d4abad5a6 Mon Sep 17 00:00:00 2001 From: star9029 Date: Fri, 9 Aug 2024 00:02:50 +0800 Subject: [PATCH] intx: add package (#4871) * intx: add package * add check --- packages/i/intx/xmake.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 packages/i/intx/xmake.lua diff --git a/packages/i/intx/xmake.lua b/packages/i/intx/xmake.lua new file mode 100644 index 00000000000..b527c8a1e13 --- /dev/null +++ b/packages/i/intx/xmake.lua @@ -0,0 +1,31 @@ +package("intx") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/chfast/intx") + set_description("Extended precision integer C++ library") + set_license("Apache-2.0") + + add_urls("https://github.com/chfast/intx/archive/refs/tags/$(version).tar.gz", + "https://github.com/chfast/intx.git") + + add_versions("v0.11.0", "bff2a78e3a9a3b9bbabf50500feae65bc0ec50a2364f4a83768277d6eba7a844") + + add_deps("cmake") + + on_check(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test(std::signed_integral auto x) {} + ]]}, {configs = {languages = "c++20"}}), "package(intx) Require at least C++20.") + end) + + on_install(function (package) + import("package.tools.cmake").install(package, {"-DINTX_TESTING=OFF"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + auto x = static_cast(intx::uint512{1} / (intx::uint512{1} << 111)); + } + ]]}, {configs = {languages = "c++20"}, includes = {"intx/intx.hpp"}})) + end)