nlohmann_json 使用 xmake 获取

This commit is contained in:
fasiondog 2021-03-28 00:53:51 +08:00
parent 96a33080a0
commit eaa40ff727
6 changed files with 7 additions and 25452 deletions

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,9 @@
#include <vector>
#include <functional>
#include <nlohmann/json.hpp>
#include "HttpValidError.h"
#include "../common/json.hpp"
#include "../common/log.h"
using json = nlohmann::json; // 不保持插入排序

View File

@ -19,7 +19,7 @@ int main(int argc, char* argv[]) {
LOG_INFO("start server ... You can press Ctrl-C stop");
HttpServer server("http://*", 520);
HttpServer server("http://*", 9001);
LoginService login(HKU_SERVICE_API(login));
login.bind(&server);

View File

@ -31,10 +31,10 @@ public:
setResHeader("Content-Type", "application/json; charset=UTF-8");
}
virtual void after_run() override {
/*virtual void after_run() override {
// 强制关闭连接,即仅有短连接
nng_http_res_set_status(m_nng_res, NNG_HTTP_STATUS_OK);
}
}*/
};
#define REST_HANDLE_IMP(cls) \

View File

@ -1,7 +1,7 @@
target("hkuserver")
set_kind("binary")
add_packages("fmt", "spdlog", "flatbuffers", "nng", "yyjson")
add_packages("fmt", "spdlog", "flatbuffers", "nng", "nlohmann_json")
add_deps("hikyuu")
add_includedirs("..")

View File

@ -40,6 +40,7 @@ add_requires("fmt", {system=false, configs = {header_only = true, vs_runtime = "
add_requires("spdlog", {system=false, configs = {header_only = true, fmt_external=true, vs_runtime = "MD"}})
add_requires("flatbuffers", {system=false, configs = {vs_runtime="MD"}})
add_requires("nng", {system=false, configs = {vs_runtime="MD"}})
add_requires("nlohmann_json", {system=false})
add_defines("SPDLOG_DISABLE_DEFAULT_LOGGER") -- 禁用 spdlog 默认 logger