Skip to content

Commit

Permalink
cmake: Add xxHash support
Browse files Browse the repository at this point in the history
  • Loading branch information
sekaiacg committed Jan 26, 2025
1 parent 18cfc34 commit 1ea9d92
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@
[submodule "src/winfsp"]
path = src/winfsp
url = https://github.com/winfsp/winfsp
[submodule "src/xxHash"]
path = src/xxHash
url = https://github.com/Cyan4973/xxHash.git
branch = dev
1 change: 1 addition & 0 deletions build/cmake/erofs-tools/erofs_tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set(common_static_link_lib
z_static
libzstd_static
pcre2
xxhash
${ld_end_group}
)

Expand Down
6 changes: 6 additions & 0 deletions build/cmake/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin|CYGWIN")
include(libext2_uuid.cmake)
endif ()

#XXHASH
set(BUILD_SHARED_LIBS OFF)
set(XXHASH_BUILD_ENABLE_INLINE_API ON)
set(XXHASH_BUILD_XXHSUM OFF)
add_subdirectory("${LIB_DIR}/xxHash/cmake_unofficial" "xxHash")

# LZ4
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(LZ4_BUILD_CLI OFF)
Expand Down
3 changes: 2 additions & 1 deletion build/cmake/lib/liberofs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ set(LIBEROFS_STATIC_DEFAULTS_CFLAGS
"-DHAVE_LIBZSTD"
"-DWITH_ANDROID"
"-DEROFS_MT_ENABLED"
"-DHAVE_XXHASH_H"
"-DHAVE_XXHASH"
"${DARWIN_CFLAGS}"
CACHE INTERNAL "liberofs_static_defaults_cflags"
)
Expand Down Expand Up @@ -101,7 +103,6 @@ set(liberofs_srcs
"${TARGET_SRC_DIR}/uuid.c"
"${TARGET_SRC_DIR}/tar.c"
"${TARGET_SRC_DIR}/block_list.c"
"${TARGET_SRC_DIR}/xxhash.c"
"${TARGET_SRC_DIR}/rebuild.c"
"${TARGET_SRC_DIR}/diskbuf.c"
"${TARGET_SRC_DIR}/uuid_unparse.c"
Expand Down
1 change: 1 addition & 0 deletions src/xxHash
Submodule xxHash added at e4e33f

0 comments on commit 1ea9d92

Please sign in to comment.