Skip to content

Commit b90797b

Browse files
xxhash: add version 0.8.3 (#2207)
1 parent 2807ec3 commit b90797b

File tree

7 files changed

+44
-1
lines changed

7 files changed

+44
-1
lines changed

cmake/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ declare_project(
189189
md4c
190190
nanosvg
191191
utf8proc
192+
xxhash
192193
zlib
193194
zstd
194195
SOURCE_DIR thirdparty/kpvcrlib
@@ -438,6 +439,9 @@ declare_project(thirdparty/turbo DEPENDS libressl)
438439
# utf8proc
439440
declare_project(thirdparty/utf8proc)
440441

442+
# xxhash
443+
declare_project(thirdparty/xxhash)
444+
441445
# xz
442446
declare_project(thirdparty/xz EXCLUDE_FROM_ALL)
443447

ffi/loadlib.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ local monolibtic = {
4545
["webp"] = true,
4646
["webpdemux"] = true,
4747
["wrap-mupdf"] = true,
48+
["xxhash"] = true,
4849
["z"] = true,
4950
["zmq"] = true,
5051
["zstd"] = true,

thirdparty/cmake_modules/koreader_targets.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ if(MONOLIBTIC)
281281
pthread
282282
sqlite::sqlite3
283283
turbo::tffi_wrap
284+
xxhash::xxhash
284285
zlib::z
285286
zstd::zstd
286287
SOURCES monolibtic.cpp

thirdparty/cmake_modules/koreader_thirdparty_libs.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ target_link_libraries(
5252
md4c::html
5353
srell::srell
5454
utf8proc::utf8proc
55+
xxhash::xxhash
5556
zlib::z
5657
zstd::zstd
5758
)
@@ -237,6 +238,9 @@ endif()
237238
# utf8proc
238239
declare_dependency(utf8proc::utf8proc MONOLIBTIC utf8proc)
239240

241+
# xxhash
242+
declare_dependency(xxhash::xxhash MONOLIBTIC xxhash)
243+
240244
# zlib
241245
declare_dependency(zlib::z MONOLIBTIC z)
242246

thirdparty/xxhash/CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
list(APPEND CMAKE_ARGS
2+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
3+
-DBUILD_SHARED_LIBS=$<NOT:$<BOOL:${MONOLIBTIC}>>
4+
)
5+
6+
list(APPEND BUILD_CMD COMMAND ninja)
7+
8+
list(APPEND INSTALL_CMD COMMAND ${CMAKE_COMMAND} --install .)
9+
10+
if(NOT MONOLIBTIC)
11+
append_shared_lib_install_commands(INSTALL_CMD xxhash VERSION 0)
12+
endif()
13+
14+
external_project(
15+
DOWNLOAD URL 599804eb9555e51c05f1b821f9212a07
16+
https://github.com/Cyan4973/xxHash/archive/refs/tags/v0.8.3.tar.gz
17+
PATCH_OVERLAY overlay
18+
CMAKE_ARGS ${CMAKE_ARGS}
19+
BUILD_COMMAND ${BUILD_CMD}
20+
INSTALL_COMMAND ${INSTALL_CMD}
21+
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
cmake_minimum_required(VERSION 3.17.5)
2+
project(xxhash LANGUAGES C)
3+
4+
add_library(xxhash)
5+
set_target_properties(xxhash PROPERTIES SOVERSION 0)
6+
target_sources(xxhash PRIVATE xxhash.c)
7+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
8+
target_compile_definitions(xxhash PRIVATE XXH_NO_INLINE_HINTS)
9+
endif()
10+
11+
install(TARGETS xxhash)
12+
install(FILES xxh3.h xxhash.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)

0 commit comments

Comments
 (0)