mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 05:25:55 +00:00
Add git commit hash to debug version string
This commit is contained in:
committed by
Nik Bougalis
parent
fbedfb25ae
commit
bf013c02ad
@@ -6,6 +6,15 @@ endif ()
|
|||||||
|
|
||||||
project (rippled)
|
project (rippled)
|
||||||
|
|
||||||
|
# make GIT_COMMIT_HASH define available to all sources
|
||||||
|
find_package(Git)
|
||||||
|
if(Git_FOUND)
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=40
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE GIT_COMMIT_HASH)
|
||||||
|
message(STATUS gch: ${GIT_COMMIT_HASH})
|
||||||
|
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
|
||||||
|
endif() #git
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/deps")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/deps")
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ char const* const versionString = "1.8.1"
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(SANITIZER)
|
#if defined(DEBUG) || defined(SANITIZER)
|
||||||
|
#ifdef GIT_COMMIT_HASH
|
||||||
|
"-" GIT_COMMIT_HASH
|
||||||
|
#endif
|
||||||
"+"
|
"+"
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
"DEBUG"
|
"DEBUG"
|
||||||
|
|||||||
Reference in New Issue
Block a user