From 922336c384b3b2ce0ced210c7878076c5269dd4e Mon Sep 17 00:00:00 2001 From: xpxz <97490782+heheda123123@users.noreply.github.com> Date: Fri, 15 Dec 2023 21:54:30 +0800 Subject: [PATCH] update snappy to 1.1.10 (#2924) * update snappy to 1.1.10 * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua --- packages/s/snappy/xmake.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index 09afcc60f..601e2e386 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -8,6 +8,7 @@ package("snappy") add_versions("1.1.8", "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f") add_versions("1.1.9", "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7") + add_versions("1.1.10", "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90") add_patches("1.1.9", path.join(os.scriptdir(), "patches", "1.1.9", "inline.patch"), "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") @@ -17,7 +18,16 @@ package("snappy") add_configs("avx2", {description = "Use the AVX2 instruction set", default = false, type = "boolean"}) add_configs("bmi2", {description = "Use the BMI2 instruction set", default = false, type = "boolean"}) + on_load(function (package) + if package:version():eq("1.1.10") and package:is_plat("android") then + raise("snappy 1.1.10 not support android.") + end + end) + on_install("windows", "linux", "macosx", "mingw", "android", function (package) + if package:version():eq("1.1.10") then + io.replace("snappy.cc", "(op + deferred_length) < op_limit_min_slop);", "static_cast(op + deferred_length) < op_limit_min_slop);", {plain = true}) + end local configs = {"-DSNAPPY_BUILD_TESTS=OFF", "-DSNAPPY_BUILD_BENCHMARKS=OFF"} table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DSNAPPY_REQUIRE_AVX=" .. (package:config("avx") and "ON" or "OFF")) @@ -34,5 +44,5 @@ package("snappy") void test(int args, char** argv) { snappy::Compress(nullptr, nullptr); } - ]]}, {configs = {languages = "c++17"}, includes = "snappy.h"})) + ]]}, {configs = {languages = "c++11"}, includes = "snappy.h"})) end)