сделал сборку с предупреждением, если версия ревизии из гита не определена. привет, Даня!
This commit is contained in:
parent
39cd5e6359
commit
2ee11b5945
@ -51,6 +51,8 @@ add_definitions(-DHTTP_MAX_PAYLOAD=200000000)
|
||||
|
||||
add_subdirectory(dependencies/control_system_client)
|
||||
|
||||
include_directories(src/)
|
||||
|
||||
add_executable(terminal-web-server
|
||||
src/server/mime_types.hpp
|
||||
src/server/mime_types.cpp
|
||||
@ -74,6 +76,7 @@ add_executable(terminal-web-server
|
||||
src/auth/jwt.h
|
||||
src/auth/utils.cpp
|
||||
src/auth/utils.h
|
||||
src/version.h
|
||||
)
|
||||
|
||||
add_definitions(-DBOOST_LOG_DYN_LINK)
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <fstream>
|
||||
|
||||
#include "terminal_api_driver.h"
|
||||
#include "version.h"
|
||||
#include "auth/resources.h"
|
||||
#include "auth/jwt.h"
|
||||
#include "auth/utils.h"
|
||||
@ -590,9 +591,12 @@ int main(int argc, char *argv[]) {
|
||||
#ifdef USE_DEBUG
|
||||
BOOST_LOG_TRIVIAL(info) << "Starting DEBUG " << argv[0];
|
||||
#else
|
||||
BOOST_LOG_TRIVIAL(info) << "Starting RELEASE build" << argv[0];
|
||||
BOOST_LOG_TRIVIAL(info) << "Starting RELEASE " << argv[0];
|
||||
#endif
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << ("Build time: " PROJECT_BUILD_TIME);
|
||||
BOOST_LOG_TRIVIAL(info) << ("Git version: " PROJECT_GIT_REVISION);
|
||||
|
||||
#ifdef USE_DEBUG
|
||||
http::auth::jwt::secretKey = "^}u'ZKyQ%;+:lnh^GS7!=G~nRK?7[{``";
|
||||
BOOST_LOG_TRIVIAL(info) << "DEBUG build use pre-created key " << http::auth::jwt::secretKey;
|
||||
|
@ -3,14 +3,10 @@
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/beast.hpp>
|
||||
#include "server.hpp"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
namespace http::server {
|
||||
const char* SERVER_HEADER_VALUE = "TerminalWebServer"
|
||||
#ifdef PROJECT_GIT_REVISION
|
||||
" " PROJECT_GIT_REVISION
|
||||
#endif
|
||||
;
|
||||
const char* SERVER_HEADER_VALUE = "TerminalWebServer " PROJECT_GIT_REVISION;
|
||||
|
||||
Connection::Connection(boost::asio::ip::tcp::socket socket, ConnectionManager &manager, request_handler handler)
|
||||
: socket_(std::move(socket)), connection_manager_(manager), request_handler_(std::move(handler)), request_(false), reply_() {
|
||||
|
12
src/version.h
Normal file
12
src/version.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
|
||||
#ifndef PROJECT_GIT_REVISION
|
||||
#warning "PROJECT_GIT_REVISION should be defined!"
|
||||
#define PROJECT_GIT_REVISION "no-git"
|
||||
#endif
|
||||
|
||||
#define PROJECT_BUILD_TIME __TIMESTAMP__
|
||||
|
||||
#endif //VERSION_H
|
Loading…
x
Reference in New Issue
Block a user