Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify drogon_ctl to show more compilation information #441

Merged
merged 3 commits into from May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/templates/config.h.in
Expand Up @@ -5,6 +5,7 @@
#cmakedefine01 USE_MYSQL
#cmakedefine01 USE_SQLITE3
#cmakedefine OpenSSL_FOUND
#cmakedefine Boost_FOUND

#cmakedefine COMPILATION_FLAGS "@COMPILATION_FLAGS@@DROGON_CXX_STANDARD@"
#cmakedefine COMPILER_COMMAND "@COMPILER_COMMAND@"
Expand Down
27 changes: 26 additions & 1 deletion drogon_ctl/version.cc
Expand Up @@ -15,6 +15,7 @@
#include "version.h"
#include <drogon/config.h>
#include <drogon/version.h>
#include <trantor/net/Resolver.h>
#include <iostream>

using namespace drogon_ctl;
Expand All @@ -32,6 +33,30 @@ void version::handleCommand(std::vector<std::string> &parameters)
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 << "Compile config: " << COMPILATION_FLAGS << " "
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") << " (batch mode: "
<< (LIBPQ_SUPPORTS_BATCH_MODE ? "yes)\n" : "no)\n")
<< " mariadb: " << (USE_MYSQL ? "yes\n" : "no\n")
<< " sqlite3: " << (USE_SQLITE3 ? "yes\n" : "no\n");
#ifdef OpenSSL_FOUND
std::cout << " openssl: yes\n";
#else
std::cout << " openssl: no\n";
#endif
#ifdef USE_BROTLI
std::cout << " brotli: yes\n";
#else
std::cout << " brotli: no\n";
#endif
#ifdef Boost_FOUND
std::cout << " boost: yes\n";
#else
std::cout << " boost: no\n";
#endif
std::cout << " c-ares: "
<< (trantor::Resolver::isCAresUsed() ? "yes\n" : "no\n");
}
2 changes: 1 addition & 1 deletion format.sh
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

#find lib orm_lib examples drogon_ctl -name *.h -o -name *.cc -exec dos2unix {} \;
find lib orm_lib examples drogon_ctl -name *.h -o -name *.cc|xargs clang-format -i -style=file
2 changes: 1 addition & 1 deletion test.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

drogon_ctl_exec=`pwd`/build/drogon_ctl/drogon_ctl
echo ${drogon_ctl_exec}
Expand Down
2 changes: 1 addition & 1 deletion trantor