diff --git a/CMakeLists.txt b/CMakeLists.txt index 6aede00..6e013ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,14 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(sockpp) +FetchContent_Declare( + zstd + URL_HASH SHA256=3b1c3b46e416d36931efd34663122d7f51b550c87f74de2d38249516fe7d8be5 + URL ${CMAKE_SOURCE_DIR}/deps/zstd-v1.5.6-mirror.zip + SOURCE_SUBDIR build/cmake +) +FetchContent_MakeAvailable(zstd) + include_directories(${CMAKE_SOURCE_DIR}/bpt/include) include_directories(${CMAKE_SOURCE_DIR}/stlite) diff --git a/deps/zstd-v1.5.6-mirror.zip b/deps/zstd-v1.5.6-mirror.zip new file mode 100644 index 0000000..d0c685f Binary files /dev/null and b/deps/zstd-v1.5.6-mirror.zip differ diff --git a/design.md b/design.md index 2b57dea..8dde41c 100644 --- a/design.md +++ b/design.md @@ -28,4 +28,5 @@ ___ - argparse:提供优雅的命令行参数解析 - googletest:调试用 - spdlog:运行日志,调试用(不是数据库系统日志) -- sockpp:服务器模式下与Python交互用 \ No newline at end of file +- sockpp:服务器模式下与Python交互用 +- zstd:为快照系统提供数据压缩(只使用最基本的压缩功能,不借用其patch功能) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bb410ad..9cefa83 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,4 +7,5 @@ add_executable(${BACKEND_EXETUABLE_NAME} main.cpp) target_link_libraries(${BACKEND_EXETUABLE_NAME} argparse) target_link_libraries(${BACKEND_EXETUABLE_NAME} spdlog::spdlog) target_link_libraries(${BACKEND_EXETUABLE_NAME} sockpp) +target_link_libraries(${BACKEND_EXETUABLE_NAME} libzstd_static) set_target_properties(${BACKEND_EXETUABLE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 929595b..d3a5ff7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,5 @@ #include +#include #include "basic_defs.h" const std::string main_version = "0.0.1"; const std::string build_version = GIT_COMMIT_HASH;