File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.14 FATAL_ERROR)
2
+
3
+ project (CPMxxHashExample)
4
+
5
+ # ---- Dependencies ----
6
+
7
+ include (../../cmake/CPM.cmake)
8
+
9
+ CPMAddPackage(
10
+ GITHUB_REPOSITORY Cyan4973/xxHash
11
+ GIT_TAG v0.8.2
12
+ OPTIONS "XXHASH_BUILD_ENABLE_INLINE_API OFF" "XXHASH_BUILD_XXHSUM OFF"
13
+ SOURCE_SUBDIR cmake_unofficial
14
+ )
15
+
16
+ # ---- Executable ----
17
+
18
+ add_executable (CPMxxHashExample main.cpp)
19
+ target_compile_features (CPMxxHashExample PRIVATE cxx_std_17)
20
+ target_link_libraries (CPMxxHashExample xxHash::xxhash)
Original file line number Diff line number Diff line change
1
+ #include < xxh3.h>
2
+
3
+ #include < iostream>
4
+
5
+ int main () {
6
+ std::string example = " Hello World!" ;
7
+ XXH64_hash_t hash = XXH3_64bits (example.data (), example.size ());
8
+
9
+ std::cout << " Hash: " << hash << std::endl;
10
+
11
+ return 0 ;
12
+ }
You can’t perform that action at this time.
0 commit comments