mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 20:19:06 +08:00
Merge pull request #1569 from codicodi/snappy-1.1.6
[snappy] update to 1.1.6
This commit is contained in:
commit
25ece10e98
@ -1,164 +0,0 @@
|
||||
# https://github.com/google/snappy/pull/29
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
|
||||
PROJECT(snappy VERSION 1.1.4 LANGUAGES C CXX)
|
||||
|
||||
option(SNAPPY_BUILD_TESTS "Build snappy tests" OFF)
|
||||
|
||||
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
INCLUDE(CheckLibraryExists)
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
INCLUDE(CMakePackageConfigHelpers)
|
||||
|
||||
CHECK_INCLUDE_FILES("byteswap.h" HAVE_BYTESWAP_H)
|
||||
CHECK_INCLUDE_FILES("dlfcn.h" HAVE_DLFCN_H)
|
||||
CHECK_INCLUDE_FILES("inttypes.h" HAVE_INTTYPES_H)
|
||||
CHECK_INCLUDE_FILES("memory.h" HAVE_MEMORY_H)
|
||||
CHECK_INCLUDE_FILES("stddef.h" HAVE_STDDEF_H)
|
||||
CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILES("stdlib.h" HAVE_STDLIB_H)
|
||||
CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H)
|
||||
CHECK_INCLUDE_FILES("string.h" HAVE_STRING_H)
|
||||
CHECK_INCLUDE_FILES("sys/byteswap.h" HAVE_SYS_BYTESWAP_H)
|
||||
CHECK_INCLUDE_FILES("sys/endian.h" HAVE_SYS_ENDIAN_H)
|
||||
CHECK_INCLUDE_FILES("sys/mman.h" HAVE_SYS_MMAN_H)
|
||||
CHECK_INCLUDE_FILES("sys/resource.h" HAVE_SYS_RESOURCE_H)
|
||||
CHECK_INCLUDE_FILES("sys/stat.h" HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILES("sys/time.h" HAVE_SYS_TIME_H)
|
||||
CHECK_INCLUDE_FILES("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
CHECK_INCLUDE_FILES("sys/uio.h" HAVE_SYS_UIO_H)
|
||||
CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
|
||||
CHECK_INCLUDE_FILES("windows.h" HAVE_WINDOWS_H)
|
||||
|
||||
IF (NOT HAVE_SYS_UIO_H)
|
||||
SET(HAVE_SYS_UIO_H 0)
|
||||
ENDIF (NOT HAVE_SYS_UIO_H)
|
||||
|
||||
IF (NOT HAVE_STDINT_H)
|
||||
SET(HAVE_STDINT_H 0)
|
||||
ENDIF (NOT HAVE_STDINT_H)
|
||||
|
||||
IF (NOT HAVE_STDDEF_H)
|
||||
SET(HAVE_STDDEF_H 0)
|
||||
ENDIF (NOT HAVE_STDDEF_H)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("int main(void) { return __builtin_expect(0, 1); }"
|
||||
HAVE_BUILTIN_EXPECT)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("int main(void) { return __builtin_ctzll(0); }"
|
||||
HAVE_BUILTIN_CTZ)
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in config.h)
|
||||
|
||||
# Configure snappy-stubs-public.h.in
|
||||
SET(ac_cv_have_stdint_h ${HAVE_STDINT_H})
|
||||
SET(ac_cv_have_stddef_h ${HAVE_STDDEF_H})
|
||||
SET(ac_cv_have_sys_uio_h ${HAVE_SYS_UIO_H})
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/snappy-stubs-public.h.in
|
||||
snappy-stubs-public.h)
|
||||
|
||||
IF (MSVC AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
|
||||
ADD_DEFINITIONS(-D__SSE2__)
|
||||
ENDIF (MSVC AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
|
||||
|
||||
IF (WIN32)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF (WIN32)
|
||||
|
||||
# Define the main library.
|
||||
ADD_LIBRARY(snappy
|
||||
snappy-c.cc
|
||||
snappy-c.h
|
||||
snappy-sinksource.cc
|
||||
snappy-sinksource.h
|
||||
snappy-stubs-internal.cc
|
||||
snappy-stubs-public.h
|
||||
snappy.cc
|
||||
snappy.h)
|
||||
|
||||
TARGET_COMPILE_DEFINITIONS(snappy PRIVATE -DHAVE_CONFIG_H)
|
||||
|
||||
SET_TARGET_PROPERTIES(snappy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
INSTALL(FILES snappy.h
|
||||
snappy-c.h
|
||||
snappy-sinksource.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/snappy-stubs-public.h
|
||||
DESTINATION include)
|
||||
|
||||
INSTALL(TARGETS snappy
|
||||
EXPORT SnappyTargets
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
INSTALL(EXPORT SnappyTargets NAMESPACE Snappy:: DESTINATION share/snappy)
|
||||
|
||||
SET(INCLUDE_INSTALL_DIR include)
|
||||
SET(LIBRARY_INSTALL_DIR lib)
|
||||
SET(BINARY_INSTALL_DIR bin)
|
||||
|
||||
WRITE_BASIC_PACKAGE_VERSION_FILE(${CMAKE_CURRENT_BINARY_DIR}/SnappyConfigVersion.cmake
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
CONFIGURE_PACKAGE_CONFIG_FILE(SnappyConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/SnappyConfig.cmake
|
||||
INSTALL_DESTINATION share/snappy
|
||||
PATH_VARS INCLUDE_INSTALL_DIR LIBRARY_INSTALL_DIR BINARY_INSTALL_DIR
|
||||
)
|
||||
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SnappyConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/SnappyConfigVersion.cmake
|
||||
DESTINATION share/snappy)
|
||||
|
||||
if (SNAPPY_BUILD_TESTS)
|
||||
FIND_PACKAGE(zlib QUIET)
|
||||
if (NOT ZLIB_FOUND)
|
||||
CHECK_LIBRARY_EXISTS(zlib zlibVersion "" HAVE_LIBZ)
|
||||
ENDIF (NOT ZLIB_FOUND)
|
||||
CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_15_compress "" HAVE_LIBLZO2)
|
||||
CHECK_LIBRARY_EXISTS(lzf lzf_compress "" HAVE_LIBLZF)
|
||||
CHECK_LIBRARY_EXISTS(fastlz fastlz_compress "" HAVE_LIBFASTLZ)
|
||||
CHECK_LIBRARY_EXISTS(quicklz qlz_compress "" HAVE_LIBQUICKLZ)
|
||||
|
||||
FIND_PACKAGE(GTest REQUIRED)
|
||||
SET(HAVE_GTEST 1)
|
||||
|
||||
FIND_PACKAGE(Gflags REQUIRED)
|
||||
SET(HAVE_GFLAGS 1)
|
||||
|
||||
ENABLE_TESTING()
|
||||
|
||||
IF (ZLIB_FOUND)
|
||||
set(HAVE_LIBZ 1)
|
||||
LIST(APPEND COMPRESSION_LIBS ${ZLIB_LIBRARIES})
|
||||
ELSE()
|
||||
LIST(APPEND COMPRESSION_LIBS zlib)
|
||||
ENDIF (ZLIB_FOUND)
|
||||
|
||||
IF (HAVE_LIBLZO2)
|
||||
LIST(APPEND COMPRESSION_LIBS lzo2)
|
||||
ENDIF (HAVE_LIBLZO2)
|
||||
|
||||
IF (HAVE_LIBLZF)
|
||||
LIST(APPEND COMPRESSION_LIBS lzf)
|
||||
ENDIF (HAVE_LIBLZF)
|
||||
|
||||
IF (HAVE_LIBFASTLZ)
|
||||
LIST(APPEND COMPRESSION_LIBS fastlz)
|
||||
ENDIF (HAVE_LIBFASTLZ)
|
||||
|
||||
IF (HAVE_LIBQUICKLZ)
|
||||
LIST(APPEND COMPRESSION_LIBS quicklz)
|
||||
ENDIF (HAVE_LIBQUICKLZ)
|
||||
|
||||
ADD_EXECUTABLE(snappy-unittest snappy_unittest.cc snappy-test.cc)
|
||||
TARGET_COMPILE_DEFINITIONS(snappy-unittest PRIVATE -DHAVE_CONFIG_H)
|
||||
TARGET_LINK_LIBRARIES(snappy-unittest snappy ${COMPRESSION_LIBS}
|
||||
${GFLAGS_LIBRARIES})
|
||||
TARGET_INCLUDE_DIRECTORIES(snappy-unittest BEFORE PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${GTEST_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS})
|
||||
|
||||
ADD_TEST(NAME snappy-unittest
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/snappy-unittest)
|
||||
endif (SNAPPY_BUILD_TESTS)
|
@ -1,3 +1,3 @@
|
||||
Source: snappy
|
||||
Version: 1.1.4-1
|
||||
Version: 1.1.6-be6dc3d
|
||||
Description: A fast compressor/decompressor.
|
||||
|
@ -1,9 +0,0 @@
|
||||
set(SNAPPY_VERSION @SNAPPY_MAJOR@.@SNAPPY_MINOR@.@SNAPPY_PATCHLEVEL@)
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set_and_check(SNAPPY_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
|
||||
set_and_check(SNAPPY_LIBRARY_DIR "@PACKAGE_LIBRARY_INSTALL_DIR@")
|
||||
set_and_check(SNAPPY_BINARY_DIR "@PACKAGE_BINARY_INSTALL_DIR@")
|
||||
|
||||
check_required_components(SNAPPY)
|
@ -1,95 +0,0 @@
|
||||
#ifndef SNAPPY_CONFIG_H
|
||||
#define SNAPPY_CONFIG_H 1
|
||||
|
||||
/* Define to 1 if the compiler supports __builtin_ctz and friends. */
|
||||
#cmakedefine HAVE_BUILTIN_CTZ ${HAVE_BUILTIN_CTZ}
|
||||
|
||||
/* Define to 1 if the compiler supports __builtin_expect. */
|
||||
#cmakedefine HAVE_BUILTIN_EXPECT ${HAVE_BUILTIN_EXPECT}
|
||||
|
||||
/* Define to 1 if you have the <byteswap.h> header file. */
|
||||
#cmakedefine HAVE_BYTESWAP_H ${HAVE_BYTESWAP_H}
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#cmakedefine HAVE_DLFCN_H ${HAVE_DLFCN_H}
|
||||
|
||||
/* Use the gflags package for command-line parsing. */
|
||||
#cmakedefine HAVE_GFLAGS ${HAVE_GFLAGS}
|
||||
|
||||
/* Defined when Google Test is available. */
|
||||
#cmakedefine HAVE_GTEST ${HAVE_GTEST}
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
|
||||
|
||||
/* Define to 1 if you have the `fastlz' library (-lfastlz). */
|
||||
#cmakedefine HAVE_LIBFASTLZ ${HAVE_LIBFASTLZ}
|
||||
|
||||
/* Define to 1 if you have the `lzf' library (-llzf). */
|
||||
#cmakedefine HAVE_LIBLZF ${HAVE_LIBLZF}
|
||||
|
||||
/* Define to 1 if you have the `lzo2' library (-llzo2). */
|
||||
#cmakedefine HAVE_LIBLZO2 ${HAVE_LIBLZO2}
|
||||
|
||||
/* Define to 1 if you have the `quicklz' library (-lquicklz). */
|
||||
#cmakedefine HAVE_LIBQUICKLZ ${HAVE_LIBQUICKLZ}
|
||||
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#cmakedefine HAVE_LIBZ ${HAVE_LIBZ}
|
||||
|
||||
/* Define to 1 if you have the <sys/uio.h> header file. */
|
||||
#cmakedefine HAVE_SYS_UIO_H ${HAVE_SYS_UIO_H}
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#cmakedefine HAVE_MEMORY_H ${HAVE_MEMORY_H}
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#cmakedefine HAVE_STDDEF_H ${HAVE_STDDEF_H}
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#cmakedefine HAVE_STDLIB_H ${HAVE_STDLIB_H}
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#cmakedefine HAVE_STRINGS_H ${HAVE_STRINGS_H}
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#cmakedefine HAVE_STRING_H ${HAVE_STRING_H}
|
||||
|
||||
/* Define to 1 if you have the <sys/byteswap.h> header file. */
|
||||
#cmakedefine HAVE_SYS_BYTESWAP_H ${HAVE_SYS_BYTESWAP_H}
|
||||
|
||||
/* Define to 1 if you have the <sys/endian.h> header file. */
|
||||
#cmakedefine HAVE_SYS_ENDIAN_H ${HAVE_SYS_ENDIAN_H}
|
||||
|
||||
/* Define to 1 if you have the <sys/mman.h> header file. */
|
||||
#cmakedefine HAVE_SYS_MMAN_H ${HAVE_SYS_MMAN_H}
|
||||
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
#cmakedefine HAVE_SYS_RESOURCE_H ${HAVE_SYS_RESOURCE_H}
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#cmakedefine HAVE_SYS_STAT_H ${HAVE_SYS_STAT_H}
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TIME_H ${HAVE_SYS_TIME_H}
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES}
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H}
|
||||
|
||||
/* Define to 1 if you have the <windows.h> header file. */
|
||||
#cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H}
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#cmakedefine WORDS_BIGENDIAN
|
||||
|
||||
#endif
|
@ -3,24 +3,33 @@ include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO google/snappy
|
||||
REF 1.1.4
|
||||
SHA512 873f655713611f4bdfc13ab2a6d09245681f427fbd4f6a7a880a49b8c526875dbdd623e203905450268f542be24a2dc9dae50e6acc1516af1d2ffff3f96553da
|
||||
REF be6dc3db83c4701e3e79694dcbfd1c3da03b91dd
|
||||
SHA512 1e01a925a2c0bab8b9a329d005384e4b620df118317fd8408ea6afdb22278a2710d26b8d51e2ef762798c757a9e01b47db55280ebb84ca290fb88ae5b18d63e3
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/SnappyConfig.cmake.in DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH})
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DSNAPPY_BUILD_TESTS=OFF)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Snappy)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
foreach(CONF debug release)
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/snappy/SnappyTargets-${CONF}.cmake CONFIG_FILE)
|
||||
string(REPLACE "lib/snappy.dll" "bin/snappy.dll" CONFIG_FILE "${CONFIG_FILE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/snappy/SnappyTargets-${CONF}.cmake "${CONFIG_FILE}")
|
||||
endforeach()
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/snappy.dll ${CURRENT_PACKAGES_DIR}/bin/snappy.dll)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/snappy.dll ${CURRENT_PACKAGES_DIR}/debug/bin/snappy.dll)
|
||||
endif()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/share/snappy/SnappyConfigVersion.cmake)
|
||||
vcpkg_fixup_cmake_targets()
|
||||
|
||||
file(COPY ${CURRENT_BUILDTREES_DIR}/src/snappy-1.1.4/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/snappy)
|
||||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/snappy)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/snappy/COPYING ${CURRENT_PACKAGES_DIR}/share/snappy/copyright)
|
||||
|
Loading…
Reference in New Issue
Block a user