Browse Source

:bug: fix build on jammy

Jeremy Zheng 1 year ago
parent
commit
63f9d3733b
4 changed files with 17 additions and 16 deletions
  1. 13 11
      coconut/README.md
  2. 0 2
      coconut/include/coconut/application.hpp
  3. 2 1
      coconut/src/application.cpp
  4. 2 2
      coconut/xmake.lua

+ 13 - 11
coconut/README.md

@@ -3,20 +3,21 @@
 ```bash
 $ cd ~/workspace
 $ ./iapt-platform/mint/docker/jammy/start.sh
-# install dependencies
-> add-apt-repository ppa:xmake-io/xmake
-> apt install xmake libpq-dev
-
 > cd /workspace/iapt-platform/mint
 > cd coconut
-# Debug
-> xmake --root f -m debug
-# Release for x86_64
-> xmake f --root -p linux --toolchain=clang -a x86_64 -m release
-# Release for aarch64
-> xmake --root f -p linux --toolchain=clang -a arm64-v8a -m release
 
-> xmake --root
+> apt update
+> apt install libverto-dev libpq-dev
+
+# debug mode
+> xmake f -m debug
+# release mode for x86_64
+> xmake f -p linux --toolchain=clang -a x86_64 -m release
+# release mode for aarch64
+> xmake f -p linux --toolchain=clang -a arm64-v8a -m release
+
+# build
+> xmake
 > tree build
 ```
 
@@ -25,6 +26,7 @@ $ ./iapt-platform/mint/docker/jammy/start.sh
 - [Fast C++ logging library](https://github.com/gabime/spdlog)
 - [A simple, small, flexible, single-header C++11 argument parsing library](https://github.com/Taywee/args)
 - [A C++ library for communicating with a RabbitMQ message broker](https://github.com/CopernicaMarketingSoftware/AMQP-CPP)
+- [Header-only TOML config file parser and serializer for C++17](https://marzer.github.io/tomlplusplus/)
 - [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)

+ 0 - 2
coconut/include/coconut/application.hpp

@@ -1,7 +1,5 @@
 #pragma once
 
-#include <lua.hpp>
-
 namespace coconut {
 class Application {
  public:

+ 2 - 1
coconut/src/application.cpp

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

+ 2 - 2
coconut/xmake.lua

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