SWDEV-539861 - add ROCclr version to logs (#612)
[ROCm/clr commit: 2ce45143d8]
This commit is contained in:
@@ -90,6 +90,23 @@ target_sources(rocclr PRIVATE
|
||||
${ROCCLR_SRC_DIR}/utils/debug.cpp
|
||||
${ROCCLR_SRC_DIR}/utils/flags.cpp)
|
||||
|
||||
find_package(Git)
|
||||
|
||||
set(ROCCLR_VERSION_GITHASH "not_found")
|
||||
if(GIT_FOUND)
|
||||
# Get commit short hash
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
RESULT_VARIABLE git_result
|
||||
OUTPUT_VARIABLE git_output
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (git_result EQUAL 0)
|
||||
set(ROCCLR_VERSION_GITHASH ${git_output})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_compile_definitions(rocclr PRIVATE ROCCLR_VERSION_GITHASH="${ROCCLR_VERSION_GITHASH}")
|
||||
|
||||
if(WIN32)
|
||||
target_sources(rocclr PRIVATE
|
||||
${ROCCLR_SRC_DIR}/platform/interop_d3d9.cpp
|
||||
|
||||
@@ -79,6 +79,7 @@ bool Runtime::init() {
|
||||
ClPrint(LOG_ERROR, LOG_INIT, "Runtime initialization failed");
|
||||
return false;
|
||||
}
|
||||
ClPrint(LOG_INFO, LOG_MISC, "ROCclr version: %s", ROCCLR_VERSION_GITHASH);
|
||||
|
||||
initialized_ = true;
|
||||
pid_ = amd::Os::getProcessId();
|
||||
|
||||
Reference in New Issue
Block a user