Skip to content

Commit

Permalink
Update 'xxhash' to v0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmallon committed Nov 1, 2023
1 parent 85caa79 commit 827f75e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ hunter_default_version(xrender VERSION 0.9.7)
hunter_default_version(xshmfence VERSION 1.3)
hunter_default_version(xtrans VERSION 1.4.0)
hunter_default_version(xxf86vm VERSION 1.1.2)
hunter_default_version(xxhash VERSION 0.6.5-p0)
hunter_default_version(xxhash VERSION 0.8.2)
hunter_default_version(yaml-cpp VERSION 0.6.3)
hunter_default_version(zip VERSION 0.1.15)
hunter_default_version(zlog VERSION 1.2.14)
Expand Down
26 changes: 26 additions & 0 deletions cmake/projects/xxhash/hunter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_download)
include(hunter_pick_scheme)
include(hunter_source_subdir)

hunter_add_version(
PACKAGE_NAME
Expand All @@ -19,6 +21,30 @@ hunter_add_version(
7d84575a45360d5c5c075ceb3fc1eb6b334aa5a4
)

hunter_add_version(
PACKAGE_NAME
xxhash
VERSION
0.8.2
URL
"https://github.com/Cyan4973/xxHash/archive/v0.8.2.tar.gz"
SHA1
8df702581ebc48a5e05be0f1ede6e1e9139e4da1
)

if(HUNTER_xxhash_VERSION VERSION_GREATER_EQUAL 0.8.2)
hunter_source_subdir(
xxhash
SOURCE_SUBDIR "cmake_unofficial"
)

hunter_cmake_args(
xxhash
CMAKE_ARGS
XXHASH_BUILD_XXHSUM=OFF
)
endif()

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(xxhash)
hunter_download(PACKAGE_NAME xxhash)
2 changes: 1 addition & 1 deletion examples/xxhash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ hunter_add_package(xxhash)
find_package(xxhash CONFIG REQUIRED)

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC xxhash)
target_link_libraries(boo PUBLIC xxHash::xxhash)
# DOCUMENTATION_END }
7 changes: 4 additions & 3 deletions examples/xxhash/boo.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <xxhash/xxhash.h>
#include <xxhash.h>

int main() {
XXH64_state_t* state = XXH64_createState();
XXH64_state_t* const state = XXH64_createState();
XXH64_update(state, "hello", 5);
XXH64_digest(state);
XXH64_hash_t const hash = XXH64_digest(state);
XXH64_freeState(state);
return 0;
}

0 comments on commit 827f75e

Please sign in to comment.