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:
parent
41a3418b7b
commit
bab4c1637e
40 changed files with 492 additions and 78 deletions
|
@ -69,7 +69,7 @@ if (TONLIB_ENABLE_JNI AND NOT ANDROID) # jni is available by default on Android
|
|||
endif()
|
||||
|
||||
add_executable(tonlib-cli tonlib/tonlib-cli.cpp)
|
||||
target_link_libraries(tonlib-cli tonlib tdactor tdutils terminal pow-miner-lib)
|
||||
target_link_libraries(tonlib-cli tonlib tdactor tdutils terminal pow-miner-lib git)
|
||||
|
||||
if (NOT CMAKE_CROSSCOMPILING)
|
||||
if (TONLIB_ENABLE_JNI)
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
#include <cinttypes>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include "git.h"
|
||||
|
||||
using tonlib_api::make_object;
|
||||
|
||||
|
@ -2308,8 +2309,8 @@ int main(int argc, char* argv[]) {
|
|||
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(FATAL) + verbosity);
|
||||
return (verbosity >= 0 && verbosity <= 20) ? td::Status::OK() : td::Status::Error("verbosity must be 0..20");
|
||||
});
|
||||
p.add_option('V', "version", "show tonlib-cli build version", [&]() {
|
||||
std::cout << "Fift build version: [" << BUILD_VERSION << "]\n";
|
||||
p.add_option('V', "version", "show tonlib-cli build information", [&]() {
|
||||
std::cout << "tonlib-cli build information: [ Commit: " << GitMetadata::CommitSHA1() << ", Date: " << GitMetadata::CommitDate() << "]\n";
|
||||
std::exit(0);
|
||||
});
|
||||
p.add_checked_option('C', "config-force", "set lite server config, drop config related blockchain cache",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue