zephyr/cmake: fix SOF_ROOT_SOURCE_DIR to fix the .ldc checksum

Fixes copy/paste of commit de41202f8f ("zephyr: build: Add initial
build support for SOF application.")

This fixes the dictionary hash when using Zephyr; no more fallback on
the git SHA1.

When using Zephyr, SOF_ROOT_SOURCE_DIR (and SOF_ROOT_BINARY_DIR) are used
only by version.cmake

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2022-01-14 05:34:10 +00:00 committed by Liam Girdwood
parent 302ebe3b03
commit f052cbffaa
2 changed files with 3 additions and 3 deletions

View File

@ -42,14 +42,14 @@ execute_process(
# the same name auto-generated in the top _build_ directory by "make
# dist", see dist.cmake
set(TARBALL_VERSION_FILE_NAME ".tarball-version")
# in Zephyr this is sof/zephyr/.tarball-version
set(TARBALL_VERSION_SOURCE_PATH "${SOF_ROOT_SOURCE_DIRECTORY}/${TARBALL_VERSION_FILE_NAME}")
if(EXISTS ${TARBALL_VERSION_SOURCE_PATH})
file(STRINGS ${TARBALL_VERSION_SOURCE_PATH} lines ENCODING "UTF-8")
list(GET lines 0 GIT_TAG)
list(GET lines 1 GIT_LOG_HASH)
message(STATUS "Found ${TARBALL_VERSION_FILE_NAME}")
message(STATUS "Found ${TARBALL_VERSION_SOURCE_PATH}")
else()
# execute_process() errors are not fatal by default!
execute_process(

View File

@ -672,7 +672,7 @@ zephyr_library_link_libraries(SOF)
target_link_libraries(SOF INTERFACE zephyr_interface)
# Setup SOF directories
set(SOF_ROOT_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(SOF_ROOT_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
set(SOF_ROOT_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
# This generated/ directory is shared with Zephyr.