mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
✨ setup xxhash as submodule build
This commit is contained in:
parent
a00a98298a
commit
1f49a9b79a
4 changed files with 5 additions and 5380 deletions
|
|
@ -11,7 +11,11 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} main.cpp )
|
add_executable(${PROJECT_NAME} main.cpp )
|
||||||
|
|
||||||
|
add_subdirectory(third_party/xxHash/cmake_unofficial xxHash/build/ EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
target_sources(${PROJECT_NAME} PRIVATE
|
target_sources(${PROJECT_NAME} PRIVATE
|
||||||
src/admin_filter.cpp
|
src/admin_filter.cpp
|
||||||
src/bank_api.cpp
|
src/bank_api.cpp
|
||||||
|
|
@ -22,7 +26,6 @@ target_sources(${PROJECT_NAME} PRIVATE
|
||||||
src/transaction.cpp
|
src/transaction.cpp
|
||||||
src/user_filter.cpp
|
src/user_filter.cpp
|
||||||
src/user.cpp
|
src/user.cpp
|
||||||
src/xxhash.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||||
|
|
@ -32,3 +35,4 @@ target_include_directories(${PROJECT_NAME} PUBLIC third_party/drogon/lib/inc)
|
||||||
add_subdirectory(third_party/drogon)
|
add_subdirectory(third_party/drogon)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE drogon)
|
target_link_libraries(${PROJECT_NAME} PRIVATE drogon)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_THREAD_LIBS_INIT} )
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_THREAD_LIBS_INIT} )
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE xxHash::xxhash)
|
||||||
5325
include/xxhash.h
5325
include/xxhash.h
File diff suppressed because it is too large
Load diff
|
|
@ -1,12 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <type_traits>
|
|
||||||
#include <string>
|
|
||||||
#include <xxhash.h>
|
|
||||||
|
|
||||||
struct xxHashStringGen
|
|
||||||
{
|
|
||||||
inline uint64_t operator()(const std::string &str) const
|
|
||||||
{
|
|
||||||
return XXH3_64bits(str.data(), str.size());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
42
src/xxhash.c
42
src/xxhash.c
|
|
@ -1,42 +0,0 @@
|
||||||
/*
|
|
||||||
* xxHash - Extremely Fast Hash algorithm
|
|
||||||
* Copyright (C) 2012-2020 Yann Collet
|
|
||||||
*
|
|
||||||
* BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above
|
|
||||||
* copyright notice, this list of conditions and the following disclaimer
|
|
||||||
* in the documentation and/or other materials provided with the
|
|
||||||
* distribution.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* You can contact the author at:
|
|
||||||
* - xxHash homepage: https://www.xxhash.com
|
|
||||||
* - xxHash source repository: https://github.com/Cyan4973/xxHash
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xxhash.c instantiates functions defined in xxhash.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define XXH_STATIC_LINKING_ONLY /* access advanced declarations */
|
|
||||||
#define XXH_IMPLEMENTATION /* access definitions */
|
|
||||||
|
|
||||||
#include "xxhash.h"
|
|
||||||
Loading…
Reference in a new issue