Skip to content

Commit

Permalink
basic commands
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuiba committed Oct 14, 2024
1 parent 3e5b1d3 commit 28c0fff
Show file tree
Hide file tree
Showing 5 changed files with 586 additions and 86 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ set(PHOTON_GOOGLETEST_SOURCE "https://github.com/google/googletest/archive/refs/
set(PHOTON_RAPIDJSON_GIT "https://github.com/Tencent/rapidjson.git" CACHE STRING "")
set(PHOTON_RAPIDXML_SOURCE "https://sourceforge.net/projects/rapidxml/files/rapidxml/rapidxml%201.13/rapidxml-1.13.zip/download" CACHE STRING "")
set(PHOTON_RAPIDYAML_SOURCE "https://github.com/biojppm/rapidyaml/releases/download/v0.5.0/rapidyaml-0.5.0.hpp" CACHE STRING "")
set(PHOTON_CPP_REDIS_SOURCE "https://github.com/cpp-redis/cpp_redis/archive/refs/tags/4.3.1.tar.gz" CACHE STRING "")

# Get CPU arch
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down
19 changes: 2 additions & 17 deletions ecosystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

include(FetchContent)

if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
# set DOWNLOAD_EXTRACT_TIMESTAMP ON cmake 3.24 or above
cmake_policy(SET CMP0135 NEW)
endif()
Expand Down Expand Up @@ -50,26 +50,11 @@ if (CMAKE_VERSION VERSION_LESS "3.18.0")
endif()
message(STATUS "Rapidyaml source dir: ${rapidyaml_SOURCE_DIR}")

# cpp-redis
FetchContent_Declare(
cpp-redis
URL ${PHOTON_CPP_REDIS_SOURCE}
URL_HASH
SHA256=3859289d8254685fc775bda73de03dad27df923423b8ceb375b02d036c03b02f
UPDATE_DISCONNECTED 1)
# uses only a simple header, so do not add sub directory to avoid unnecessary build
# do not use FetchContent_MakeAvailable, just populate it.
FetchContent_GetProperties(cpp-redis)
if(NOT cpp-redis_POPULATED)
FetchContent_Populate(cpp-redis)
endif()
message(STATUS "cpp-redis source dir: ${cpp-redis_SOURCE_DIR}")

add_library(ecosystem_deps INTERFACE)
target_include_directories(
ecosystem_deps
INTERFACE ${rapidjson_SOURCE_DIR}/include ${rapidxml_SOURCE_DIR} ${rapidyaml_SOURCE_DIR}
${cpp-redis_SOURCE_DIR}/includes)
)
get_property(
incs
TARGET ecosystem_deps
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/redis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace photon {
using namespace net;
namespace redis {

any BufferedStream::parse_item() {
any BufferedStream::parse_response_item() {
switch (auto mark = this->get_char()) {
case simple_string::mark():
return get_simple_string();
Expand Down
Loading

0 comments on commit 28c0fff

Please sign in to comment.