From f052cbffaadc4c85a1bb93d6104b8d456adf870c Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 14 Jan 2022 05:34:10 +0000 Subject: [PATCH] zephyr/cmake: fix SOF_ROOT_SOURCE_DIR to fix the .ldc checksum Fixes copy/paste of commit de41202f8fea ("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 --- scripts/cmake/version.cmake | 4 ++-- zephyr/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/version.cmake b/scripts/cmake/version.cmake index 424fb090a..6932a64e7 100644 --- a/scripts/cmake/version.cmake +++ b/scripts/cmake/version.cmake @@ -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( diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index a08ce761d..3e200d950 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -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.