소스 검색

:hammer: add grpc & httplib support

Jeremy Zheng 1 년 전
부모
커밋
a33cfa75aa
3개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      coconut/README.md
  2. 3 0
      coconut/src/application.cpp
  3. 3 2
      coconut/xmake.lua

+ 2 - 0
coconut/README.md

@@ -27,3 +27,5 @@ $ ./iapt-platform/mint/docker/jammy/start.sh
 - [A C++ library for communicating with a RabbitMQ message broker](https://github.com/CopernicaMarketingSoftware/AMQP-CPP)
 - [JSON for Modern C++](https://github.com/nlohmann/json)
 - [Lua](https://www.lua.org/manual/)
+- [A C++ header-only HTTP/HTTPS server and client library](https://github.com/yhirose/cpp-httplib)
+- [A basic tutorial introduction to gRPC in C++](https://grpc.io/docs/languages/cpp/basics/)

+ 3 - 0
coconut/src/application.cpp

@@ -2,7 +2,10 @@
 
 #include <spdlog/spdlog.h>
 #include <args.hxx>
+#include <grpcpp/grpcpp.h>
+#include <google/protobuf/stubs/common.h>
 
 coconut::Application::Application(int argc, char** argv) {
+    spdlog::info("grpc({}), protobuf({})", grpc::Version(), google::protobuf::internal::VersionString(GOOGLE_PROTOBUF_VERSION));
     spdlog::info("hello coconut!");
 }

+ 3 - 2
coconut/xmake.lua

@@ -3,7 +3,7 @@ set_languages("c11", "c++20")
 
 add_requires(
     "libpqxx", "redis-plus-plus", "amqp-cpp", 
-    "nlohmann_json",
+    "nlohmann_json", "cpp-httplib", "grpc",
     "lua", "spdlog", "taywee_args"
 )
 
@@ -13,6 +13,7 @@ target("coconut")
     add_files("src/*.cpp")
     add_packages(
         "libpqxx", "redis-plus-plus", "amqp-cpp",
-        "nlohmann_json", 
+        "nlohmann_json", "cpp-httplib", 
+        "abseil", "grpc",
         "lua", "spdlog", "taywee_args"
     )