diff --git a/scripts/cmake/version.cmake b/scripts/cmake/version.cmake index 2f3cd63c9..9d234963f 100644 --- a/scripts/cmake/version.cmake +++ b/scripts/cmake/version.cmake @@ -84,7 +84,11 @@ if(EXISTS ${SOF_ROOT_SOURCE_DIRECTORY}/.git/) string(SUBSTRING ${SOF_SRC_HASH_LONG} 0 8 SOF_SRC_HASH) message(STATUS "Source content hash: ${SOF_SRC_HASH}") else() - string(SUBSTRING ${GIT_LOG_HASH} 0 8 SOF_SRC_HASH) + if("${GIT_LOG_HASH}") + string(SUBSTRING "${GIT_LOG_HASH}" 0 8 SOF_SRC_HASH) + else() + set(SOF_SRC_HASH "0") + endif() message(WARNING "Source content hash not computed without git, using GIT_LOG_HASH instead") endif()