1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

Merge pull request #1626 from LeeYoung624/dev

add cmake lz4 support
This commit is contained in:
Yann Collet
2019-06-19 13:35:33 -07:00
committed by GitHub
3 changed files with 104 additions and 0 deletions

View File

@ -85,7 +85,9 @@ endif ()
option(ZSTD_ZLIB_SUPPORT "ZLIB SUPPORT" OFF)
option(ZSTD_LZMA_SUPPORT "LZMA SUPPORT" OFF)
option(ZSTD_LZ4_SUPPORT "LZ4 SUPPORT" OFF)
# Add gzip support
if (ZSTD_ZLIB_SUPPORT)
find_package(ZLIB REQUIRED)
@ -98,6 +100,7 @@ if (ZSTD_ZLIB_SUPPORT)
endif ()
endif ()
# Add lzma support
if (ZSTD_LZMA_SUPPORT)
find_package(LibLZMA REQUIRED)
@ -109,3 +112,16 @@ if (ZSTD_LZMA_SUPPORT)
message(SEND_ERROR "lzma library is missing")
endif ()
endif ()
# Add lz4 support
if (ZSTD_LZ4_SUPPORT)
find_package(LibLZ4 REQUIRED)
if (LIBLZ4_FOUND)
include_directories(${LIBLZ4_INCLUDE_DIRS})
target_link_libraries(zstd ${LIBLZ4_LIBRARIES})
set_property(TARGET zstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_LZ4COMPRESS;ZSTD_LZ4DECOMPRESS")
else ()
message(SEND_ERROR "lz4 library is missing")
endif ()
endif ()