feature: supports git SHA logging to log file

Related-To: NEO-11364

Signed-off-by: Kulkarni, Ashwin Kumar <ashwin.kumar.kulkarni@intel.com>
This commit is contained in:
Kulkarni, Ashwin Kumar
2024-05-18 08:54:36 +00:00
committed by Compute-Runtime-Automation
parent 9f4c1b3daf
commit fbb8fa7dea
6 changed files with 72 additions and 28 deletions

View File

@ -54,24 +54,24 @@ else()
endif()
endif()
if(NOT DEFINED NEO_VERSION_BUILD)
set(NEO_VERSION_BUILD 0)
set(NEO_REVISION 0)
else()
find_program(GIT NAMES git)
if(NOT "${GIT}" STREQUAL "GIT-NOTFOUND")
if(IS_DIRECTORY ${NEO_SOURCE_DIR}/.git)
set(GIT_arg --git-dir=${NEO_SOURCE_DIR}/.git rev-parse HEAD)
execute_process(
COMMAND ${GIT} ${GIT_arg}
OUTPUT_VARIABLE NEO_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
find_program(GIT NAMES git)
if(NOT "${GIT}" STREQUAL "GIT-NOTFOUND")
if(IS_DIRECTORY ${NEO_SOURCE_DIR}/.git)
set(GIT_arg --git-dir=${NEO_SOURCE_DIR}/.git rev-parse HEAD)
execute_process(
COMMAND ${GIT} ${GIT_arg}
OUTPUT_VARIABLE NEO_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
endif()
if(NOT DEFINED NEO_REVISION)
set(NEO_REVISION 0)
set(NEO_REVISION "No git SHA found, compiled outside git folder")
endif()
if(NOT DEFINED NEO_VERSION_BUILD)
set(NEO_VERSION_BUILD 0)
endif()
if(NOT DEFINED NEO_VERSION_HOTFIX)