Skip to content

Commit

Permalink
cmake: Handle empty SOF_SRC_HASH_LONG
Browse files Browse the repository at this point in the history
SOF_SRC_HASH always must have integer value, because of usage
them to initialize global variable in source code.
Variables, which may be empty should be used inside quotation
to prevent cmake incorect number of arguments error.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
  • Loading branch information
ktrzcinx authored and lgirdwood committed Sep 1, 2020
1 parent 67e41d2 commit b2a325a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b2a325a

Please sign in to comment.