From fe02c217749deab9c8d9c843f74cf82eeece75f4 Mon Sep 17 00:00:00 2001 From: xpxz <97490782+heheda123123@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:33:47 +0800 Subject: [PATCH] add standardlib (#2911) --- packages/s/standardlib/xmake.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/s/standardlib/xmake.lua diff --git a/packages/s/standardlib/xmake.lua b/packages/s/standardlib/xmake.lua new file mode 100644 index 000000000..5b96ec341 --- /dev/null +++ b/packages/s/standardlib/xmake.lua @@ -0,0 +1,24 @@ +package("standardlib") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/gregoryc/standardlib") + set_description("an actually usable and maximally efficient C standard library to make C as easy (or easier) than other languages") + + add_urls("https://github.com/gregoryc/standardlib.git") + add_versions("2023.12.5", "4fb308a5716927e5622a0488d7aa104660c96841") + + on_install("linux", function (package) + os.cp("standardlib.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "standardlib.h" + #include + void test() { + const char *text = "This is a sample text"; + const char *suffix = "text"; + printf("Does the string end with \"%s\"? %s\n", suffix, ends_with(text, suffix) ? "Yes" : "No"); + } + ]]})) + end)