mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-08 00:23:03 +00:00
### Description Git commands producing `git-commid-id` and `git-branch` are always run in `CMAKE_CURRENT_SOURCE_DIR` (i.e. `onnxruntime/cmake`) ### Motivation and Context Please refer to corresponding issue [#17197](https://github.com/microsoft/onnxruntime/issues/17197).
This commit is contained in:
parent
6ea3908db4
commit
e3bb2a0cdd
1 changed files with 2 additions and 0 deletions
|
|
@ -1336,9 +1336,11 @@ set(ORT_BUILD_INFO "ORT Build Info: ")
|
|||
find_package(Git)
|
||||
if (Git_FOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE ORT_GIT_COMMIT)
|
||||
string(STRIP "${ORT_GIT_COMMIT}" ORT_GIT_COMMIT)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE ORT_GIT_BRANCH)
|
||||
string(STRIP "${ORT_GIT_BRANCH}" ORT_GIT_BRANCH)
|
||||
string(APPEND ORT_BUILD_INFO "git-branch=${ORT_GIT_BRANCH}, git-commit-id=${ORT_GIT_COMMIT}, ")
|
||||
|
|
|
|||
Loading…
Reference in a new issue