cmake: set git hash to 8 digit

GIT_LOG_HASH can be more than 8 digits. Limit hash value up to
first 8 digits.

fixes: #3322

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
This commit is contained in:
Liam Girdwood 2020-08-21 13:44:47 +01:00 committed by Liam Girdwood
parent 2e07bb9d89
commit 7a10da097c
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
string(SUBSTRING ${SOF_SRC_HASH_LONG} 0 8 SOF_SRC_HASH)
message(STATUS "Source content hash: ${SOF_SRC_HASH}")
else()
set(SOF_SRC_HASH ${GIT_LOG_HASH})
string(SUBSTRING ${GIT_LOG_HASH} 0 8 SOF_SRC_HASH)
message(WARNING "Source content hash can't be calculated, use GIT_LOG_HASH")
endif()