From 474bb688a1c594fee077843c453f86cce42c90b2 Mon Sep 17 00:00:00 2001 From: Harry Mallon Date: Wed, 1 Nov 2023 19:05:52 +0000 Subject: [PATCH] Update 'xxHash' to v0.8.2 (#721) * Rename from xxhash --- cmake/configs/default.cmake | 2 +- cmake/projects/xxHash/hunter.cmake | 50 ++++++++++++++++++++ cmake/projects/xxhash/hunter.cmake | 24 ---------- docs/packages/pkg/{xxhash.rst => xxHash.rst} | 10 ++-- examples/{xxhash => xxHash}/CMakeLists.txt | 8 ++-- examples/xxHash/boo.cpp | 11 +++++ examples/xxhash/boo.cpp | 8 ---- 7 files changed, 71 insertions(+), 42 deletions(-) create mode 100644 cmake/projects/xxHash/hunter.cmake delete mode 100644 cmake/projects/xxhash/hunter.cmake rename docs/packages/pkg/{xxhash.rst => xxHash.rst} (79%) rename examples/{xxhash => xxHash}/CMakeLists.txt (66%) create mode 100644 examples/xxHash/boo.cpp delete mode 100644 examples/xxhash/boo.cpp diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index 9dbcf7456d..8cffb397f2 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -600,8 +600,8 @@ hunter_default_version(xrandr VERSION 1.3.2) 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(xxHash VERSION 0.8.2) hunter_default_version(xxf86vm VERSION 1.1.2) -hunter_default_version(xxhash VERSION 0.6.5-p0) 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) diff --git a/cmake/projects/xxHash/hunter.cmake b/cmake/projects/xxHash/hunter.cmake new file mode 100644 index 0000000000..9c2bab884c --- /dev/null +++ b/cmake/projects/xxHash/hunter.cmake @@ -0,0 +1,50 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +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 + xxHash + VERSION + 0.6.5-p0 + URL + "https://github.com/hunter-packages/xxHash/archive/0.6.5-p0.tar.gz" + SHA1 + 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) diff --git a/cmake/projects/xxhash/hunter.cmake b/cmake/projects/xxhash/hunter.cmake deleted file mode 100644 index aba3e9fc6d..0000000000 --- a/cmake/projects/xxhash/hunter.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2016-2018, Ruslan Baratov -# All rights reserved. - -# !!! DO NOT PLACE HEADER GUARDS HERE !!! - -include(hunter_add_version) -include(hunter_cacheable) -include(hunter_download) -include(hunter_pick_scheme) - -hunter_add_version( - PACKAGE_NAME - xxhash - VERSION - 0.6.5-p0 - URL - "https://github.com/hunter-packages/xxHash/archive/0.6.5-p0.tar.gz" - SHA1 - 7d84575a45360d5c5c075ceb3fc1eb6b334aa5a4 -) - -hunter_pick_scheme(DEFAULT url_sha1_cmake) -hunter_cacheable(xxhash) -hunter_download(PACKAGE_NAME xxhash) diff --git a/docs/packages/pkg/xxhash.rst b/docs/packages/pkg/xxHash.rst similarity index 79% rename from docs/packages/pkg/xxhash.rst rename to docs/packages/pkg/xxHash.rst index a2fc7897c5..046f343108 100644 --- a/docs/packages/pkg/xxhash.rst +++ b/docs/packages/pkg/xxHash.rst @@ -1,13 +1,13 @@ .. spelling:: - xxhash + xxHash .. index:: - single: crypto ; xxhash + single: crypto ; xxHash -.. _pkg.xxhash: +.. _pkg.xxHash: -xxhash +xxHash ====== - `Official `__ @@ -15,7 +15,7 @@ xxhash - `Example `__ - Added by `Warchant `__ (`pr-1738 `__) -.. literalinclude:: /../examples/xxhash/CMakeLists.txt +.. literalinclude:: /../examples/xxHash/CMakeLists.txt :language: cmake :start-after: # DOCUMENTATION_START { :end-before: # DOCUMENTATION_END } diff --git a/examples/xxhash/CMakeLists.txt b/examples/xxHash/CMakeLists.txt similarity index 66% rename from examples/xxhash/CMakeLists.txt rename to examples/xxHash/CMakeLists.txt index 40043446b2..197f2b1a14 100644 --- a/examples/xxhash/CMakeLists.txt +++ b/examples/xxHash/CMakeLists.txt @@ -7,12 +7,12 @@ cmake_minimum_required(VERSION 3.5) # * https://github.com/hunter-packages/gate include("../common.cmake") -project(download-xxhash) +project(download-xxHash) # DOCUMENTATION_START { -hunter_add_package(xxhash) -find_package(xxhash CONFIG REQUIRED) +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 } diff --git a/examples/xxHash/boo.cpp b/examples/xxHash/boo.cpp new file mode 100644 index 0000000000..3c718df6a3 --- /dev/null +++ b/examples/xxHash/boo.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main() { + XXH64_state_t* const state = XXH64_createState(); + XXH64_update(state, "hello", 5); + XXH64_hash_t const hash = XXH64_digest(state); + std::cout << std::hex << hash << std::endl; + XXH64_freeState(state); + return 0; +} diff --git a/examples/xxhash/boo.cpp b/examples/xxhash/boo.cpp deleted file mode 100644 index 250427d805..0000000000 --- a/examples/xxhash/boo.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() { - XXH64_state_t* state = XXH64_createState(); - XXH64_update(state, "hello", 5); - XXH64_digest(state); - return 0; -}