mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-30 02:37:57 +08:00
17c80508c0
* Drop C++14 Support * Update README.md * Remove drogon::optional in favor of std::optional * Remove drogon::filesystem in favor of std::filesystem * Remove boost::string_view and pre-c++17 hacks * Remove boost::any * Remove the string_view.h and the any.h * Remove boost lib * Update .clang-format and ci Co-authored-by: Omar Mohamed <omar@omar-laptop.lan> Co-authored-by: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Co-authored-by: An Tao <antao2002@gmail.com> Co-authored-by: albaropereyra22 <141711575+albaropereyra22@users.noreply.github.com> Co-authored-by: Yoshihiro Hokazono <47231909+hokacci@users.noreply.github.com> Co-authored-by: Omar Mohamed Khallaf <51155980+omarmohamedkh@users.noreply.github.com>
69 lines
2.1 KiB
C++
69 lines
2.1 KiB
C++
/**
|
|
*
|
|
* version.cc
|
|
* An Tao
|
|
*
|
|
* Copyright 2018, An Tao. All rights reserved.
|
|
* https://github.com/an-tao/drogon
|
|
* Use of this source code is governed by a MIT license
|
|
* that can be found in the License file.
|
|
*
|
|
* Drogon
|
|
*
|
|
*/
|
|
|
|
#include "version.h"
|
|
#include <drogon/config.h>
|
|
#include <drogon/version.h>
|
|
#include <drogon/utils/Utilities.h>
|
|
#include <trantor/net/Resolver.h>
|
|
#include <trantor/utils/Utilities.h>
|
|
#include <iostream>
|
|
|
|
using namespace drogon_ctl;
|
|
static const char banner[] =
|
|
R"( _
|
|
__| |_ __ ___ __ _ ___ _ __
|
|
/ _` | '__/ _ \ / _` |/ _ \| '_ \
|
|
| (_| | | | (_) | (_| | (_) | | | |
|
|
\__,_|_| \___/ \__, |\___/|_| |_|
|
|
|___/
|
|
)";
|
|
|
|
void version::handleCommand(std::vector<std::string> ¶meters)
|
|
{
|
|
const auto tlsBackend = trantor::utils::tlsBackend();
|
|
const bool tlsSupported = drogon::utils::supportsTls();
|
|
std::cout << banner << std::endl;
|
|
std::cout << "A utility for drogon" << std::endl;
|
|
std::cout << "Version: " << DROGON_VERSION << std::endl;
|
|
std::cout << "Git commit: " << DROGON_VERSION_SHA1 << std::endl;
|
|
std::cout << "Compilation: \n Compiler: " << COMPILER_COMMAND
|
|
<< "\n Compiler ID: " << COMPILER_ID
|
|
<< "\n Compilation flags: " << COMPILATION_FLAGS
|
|
<< INCLUDING_DIRS << std::endl;
|
|
std::cout << "Libraries: \n postgresql: "
|
|
<< (USE_POSTGRESQL ? "yes" : "no") << " (pipeline mode: "
|
|
<< (LIBPQ_SUPPORTS_BATCH_MODE ? "yes)\n" : "no)\n")
|
|
<< " mariadb: " << (USE_MYSQL ? "yes\n" : "no\n")
|
|
<< " sqlite3: " << (USE_SQLITE3 ? "yes\n" : "no\n");
|
|
std::cout << " ssl/tls backend: " << tlsBackend << "\n";
|
|
#ifdef USE_BROTLI
|
|
std::cout << " brotli: yes\n";
|
|
#else
|
|
std::cout << " brotli: no\n";
|
|
#endif
|
|
#ifdef USE_REDIS
|
|
std::cout << " hiredis: yes\n";
|
|
#else
|
|
std::cout << " hiredis: no\n";
|
|
#endif
|
|
std::cout << " c-ares: "
|
|
<< (trantor::Resolver::isCAresUsed() ? "yes\n" : "no\n");
|
|
#ifdef HAS_YAML_CPP
|
|
std::cout << " yaml-cpp: yes\n";
|
|
#else
|
|
std::cout << " yaml-cpp: no\n";
|
|
#endif
|
|
}
|