[snappy] Update to 1.1.10 and disable optimizations based on hardware support (#26828)

This commit is contained in:
Osyotr 2023-07-27 05:54:11 +03:00 committed by GitHub
parent f204b54154
commit 16eeb024de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 7 deletions

View File

@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,7 @@
# Use -Werror for clang only.
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
+ if(0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")

View File

@ -5,10 +5,11 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/snappy
REF ${version}
SHA512 f1f8a90f5f7f23310423574b1d8c9acb84c66ea620f3999d1060395205e5760883476837aba02f0aa913af60819e34c625d8308c18a5d7a9c4e190f35968b024
SHA512 3578597f1d4ec09104ce0296b825b013590351230dfe56c635081fd282ce7a13a34caf2c283ac77bd24065e2d27af6db068d1f84b98cec2fd39a0e37a0d77070
HEAD_REF master
PATCHES
fix_clang-cl_build.patch
no-werror.patch
)
vcpkg_cmake_configure(
@ -16,13 +17,19 @@ vcpkg_cmake_configure(
OPTIONS
-DSNAPPY_BUILD_TESTS=OFF
-DSNAPPY_BUILD_BENCHMARKS=OFF
# These variables can be overriden in a custom triplet, see usage file
-DSNAPPY_HAVE_SSSE3=OFF
-DSNAPPY_HAVE_X86_CRC32=OFF
-DSNAPPY_HAVE_NEON_CRC32=OFF
-DSNAPPY_HAVE_BMI2=OFF
-DSNAPPY_HAVE_NEON=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Snappy)
vcpkg_copy_pdbs()
string(JSON version GET "${manifest}" version)
string(JSON description GET "${manifest}" description)
set(name "${PORT}")
@ -34,4 +41,7 @@ endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

13
ports/snappy/usage Normal file
View File

@ -0,0 +1,13 @@
snappy provides CMake targets:
find_package(Snappy CONFIG REQUIRED)
target_link_libraries(main PRIVATE Snappy::snappy)
Optimizations based on hardware support are disabled by default.
You can enable them by adding corresponding flags to VCPKG_CMAKE_CONFIGURE_OPTIONS inside a custom triplet file, for example:
if("${PORT}" STREQUAL "snappy")
list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DSNAPPY_HAVE_SSSE3=ON -DSNAPPY_HAVE_BMI2=ON)
endif()
For a full list of possible options, see project's root CMakeLists.txt.

View File

@ -1,7 +1,6 @@
{
"name": "snappy",
"version": "1.1.9",
"port-version": 5,
"version": "1.1.10",
"description": "A fast compressor/decompressor.",
"homepage": "https://github.com/google/snappy",
"license": null,

View File

@ -7621,8 +7621,8 @@
"port-version": 9
},
"snappy": {
"baseline": "1.1.9",
"port-version": 5
"baseline": "1.1.10",
"port-version": 0
},
"sndfile": {
"baseline": "0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "674abac6de71455f63c6649f436ff0801545ae00",
"version": "1.1.10",
"port-version": 0
},
{
"git-tree": "a97f6aac039dc2b5e6fdac753d66b94cfb408d30",
"version": "1.1.9",