Skip to content

Commit

Permalink
Made lz4 external dependency #48 (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
EshUno authored Mar 22, 2024
1 parent 5e2aec3 commit 037cbf5
Show file tree
Hide file tree
Showing 26 changed files with 36 additions and 9,194 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ If you ok with this warning, then...
- xxhash
- zlib
- zstd
- lz4
- snappy 1.1.8+


## Runtime requirements

- libidn11-dev (IDN)
Expand All @@ -39,7 +41,7 @@ If you ok with this warning, then...
sudo apt-get -y update
sudo apt-get -y install git cmake ninja-build libidn11-dev ragel yasm protobuf-compiler \
protobuf-compiler-grpc libprotobuf-dev libgrpc++-dev libgrpc-dev libgrpc++1 libgrpc10 \
rapidjson-dev zlib1g-dev libxxhash-dev libzstd-dev libsnappy-dev
rapidjson-dev zlib1g-dev libxxhash-dev libzstd-dev libsnappy-dev liblz4-dev

wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
Expand Down
26 changes: 26 additions & 0 deletions cmake/FindLZ4.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
find_library(LZ4_LIBRARIES
NAMES lz4 liblz4
HINTS $ENV{LZ4_ROOT}/lib
)

find_path(LZ4_INCLUDE_DIR
NAMES lz4.h lz4hc.h
HINTS $ENV{LZ4_ROOT}/include
)

set(LZ4_INCLUDE_DIRS
${LZ4_INCLUDE_DIR}
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LZ4 DEFAULT_MSG LZ4_LIBRARIES LZ4_INCLUDE_DIRS)

mark_as_advanced(LZ4_LIBRARIES LZ4_INCLUDE_DIRS)

if(LZ4_FOUND AND NOT LZ4::LZ4)
add_library(LZ4::LZ4 UNKNOWN IMPORTED)
set_target_properties( LZ4::LZ4 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIRS}"
IMPORTED_LOCATION ${LZ4_LIBRARIES})
endif()

1 change: 1 addition & 0 deletions cmake/external_libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ find_package(RapidJSON REQUIRED)
find_package(ZLIB REQUIRED)
find_package(xxHash REQUIRED)
find_package(ZSTD REQUIRED)
find_package(LZ4 REQUIRED)
find_package(Snappy 1.1.8 REQUIRED CONFIG)

# rapidjson
Expand Down
1 change: 0 additions & 1 deletion contrib/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ add_subdirectory(fastlz)
add_subdirectory(jwt-cpp)
add_subdirectory(libbz2)
add_subdirectory(libc_compat)
add_subdirectory(lz4)
add_subdirectory(lzmasdk)
add_subdirectory(nayuki_md5)
#add_subdirectory(zstd)
Expand Down
22 changes: 0 additions & 22 deletions contrib/libs/lz4/CMakeLists.darwin-arm64.txt

This file was deleted.

22 changes: 0 additions & 22 deletions contrib/libs/lz4/CMakeLists.darwin-x86_64.txt

This file was deleted.

22 changes: 0 additions & 22 deletions contrib/libs/lz4/CMakeLists.linux-aarch64.txt

This file was deleted.

22 changes: 0 additions & 22 deletions contrib/libs/lz4/CMakeLists.linux-x86_64.txt

This file was deleted.

19 changes: 0 additions & 19 deletions contrib/libs/lz4/CMakeLists.txt

This file was deleted.

22 changes: 0 additions & 22 deletions contrib/libs/lz4/CMakeLists.windows-x86_64.txt

This file was deleted.

24 changes: 0 additions & 24 deletions contrib/libs/lz4/LICENSE

This file was deleted.

169 changes: 0 additions & 169 deletions contrib/libs/lz4/README.md

This file was deleted.

Loading

0 comments on commit 037cbf5

Please sign in to comment.