From 7fb3e89fd31aba2d87c3a5e9857f63f07f9e7c0a Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 13 Mar 2023 20:00:56 +0800 Subject: [PATCH] add utf8 range (#1915) --- packages/u/utf8_range/xmake.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/u/utf8_range/xmake.lua diff --git a/packages/u/utf8_range/xmake.lua b/packages/u/utf8_range/xmake.lua new file mode 100644 index 000000000..f61a49d70 --- /dev/null +++ b/packages/u/utf8_range/xmake.lua @@ -0,0 +1,20 @@ +package("utf8_range") + set_homepage("https://github.com/protocolbuffers/utf8_range") + set_description("Utf8 range") + set_license("MIT") + + add_urls("https://github.com/protocolbuffers/utf8_range.git") + add_versions("2022.11.15", "72c943dea2b9240cd09efde15191e144bc7c7d38") + + add_deps("cmake", "abseil") + + on_install("linux", "macosx", "windows", function (package) + local configs = {"-Dutf8_range_ENABLE_TESTS=OFF", "-DCMAKE_CXX_STANDARD=11"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("utf8_range2", {includes = "utf8_range.h"})) + end)