improve snappy (#3515)

* improve snappy

* fix armv7 for android
pull/3539/head
ruki 1 year ago committed by GitHub
parent cfa67723a8
commit b96da33fdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      packages/s/snappy/patches/1.1.10/cmake.patch
  2. 9
      packages/s/snappy/xmake.lua

@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3062e2..47443d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,9 +194,9 @@ int main() {
check_cxx_source_compiles("
#include <arm_neon.h>
int main() {
- uint8_t val = 3, dup[8];
+ uint8_t val = 3;
uint8x16_t v = vld1q_dup_u8(&val);
- vst1q_u8(dup, v);
+ val = vmaxvq_u8(v);
return 0;
}" SNAPPY_HAVE_NEON)

@ -10,7 +10,8 @@ package("snappy")
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")
add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b")
add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb")
add_deps("cmake")
@ -18,12 +19,6 @@ 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<ptrdiff_t>(op + deferred_length) < op_limit_min_slop);", {plain = true})

Loading…
Cancel
Save