1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Automatically integrates git build information into executables.

Usage:
func.exe -V
adnl-pong -V
validator-engine -V
and so on.
Result will be shown in the following format:
Func build information: [ Commit: d8b751d7a5, Date: 2021-02-27 14:34:41 +0200]
This commit is contained in:
Alex Melman 2021-03-26 00:26:49 +02:00 committed by main
parent 41a3418b7b
commit bab4c1637e
40 changed files with 492 additions and 78 deletions

View file

@ -89,12 +89,12 @@ target_link_libraries(adnl PUBLIC tdactor ton_crypto tl_api tdnet tddb keys keyr
add_executable(adnl-proxy ${ADNL_PROXY_SOURCE})
target_include_directories(adnl-proxy PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
target_link_libraries(adnl-proxy PUBLIC tdactor ton_crypto tl_api tdnet common
tl-utils)
tl-utils git)
add_executable(adnl-pong adnl-pong.cpp)
target_include_directories(adnl-pong PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
target_link_libraries(adnl-pong PUBLIC tdactor ton_crypto tl_api tdnet common
tl-utils adnl dht)
tl-utils adnl dht git)
add_library(adnltest STATIC ${ADNL_TEST_SOURCE})
target_include_directories(adnltest PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
@ -105,4 +105,4 @@ endif()
add_library(adnllite STATIC ${ADNL_LITE_SOURCE})
target_include_directories(adnllite PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
target_link_libraries(adnllite PUBLIC tdactor ton_crypto tl_lite_api tdnet keys )
target_link_libraries(adnllite PUBLIC tdactor ton_crypto tl_lite_api tdnet keys)

View file

@ -41,6 +41,7 @@
#include "auto/tl/ton_api_json.h"
#include "adnl/adnl.h"
#include <map>
#include "git.h"
#if TD_DARWIN || TD_LINUX
#include <unistd.h>
@ -97,8 +98,8 @@ int main(int argc, char *argv[]) {
int v = VERBOSITY_NAME(FATAL) + (td::to_integer<int>(arg));
SET_VERBOSITY_LEVEL(v);
});
p.add_option('V', "version", "shows adnl-pong build version", [&]() {
std::cout << "adnl-pong build version: [" << BUILD_VERSION << "]\n";
p.add_option('V', "version", "shows adnl-pong build information", [&]() {
std::cout << "adnl-pong build information: [ Commit: " << GitMetadata::CommitSHA1() << ", Date: " << GitMetadata::CommitDate() << "]\n";
std::exit(0);
});
p.add_option('h', "help", "prints_help", [&]() {

View file

@ -43,6 +43,7 @@
#include "adnl-proxy-types.h"
#include "adnl-received-mask.h"
#include <map>
#include "git.h"
#if TD_DARWIN || TD_LINUX
#include <unistd.h>
@ -303,8 +304,8 @@ int main(int argc, char *argv[]) {
int v = VERBOSITY_NAME(FATAL) + (td::to_integer<int>(arg));
SET_VERBOSITY_LEVEL(v);
});
p.add_option('V', "version", "shows adnl-proxy build version", [&]() {
std::cout << "adnl-proxy build version: [" << BUILD_VERSION << "]\n";
p.add_option('V', "version", "shows adnl-proxy build information", [&]() {
std::cout << "adnl-proxy build information: [ Commit: " << GitMetadata::CommitSHA1() << ", Date: " << GitMetadata::CommitDate() << "]\n";
std::exit(0);
});
p.add_option('h', "help", "prints_help", [&]() {