mirror of https://github.com/thesofproject/sof.git
cmake: defer the rimage build until it's actually needed.
This is motivated by the zephyr.elf build that does not need rimage at all. Also build smex later, only when it's needed. After building and deleting the rimage/ clone, a plain SOF clean + RE-build now fails much later: it now fails AFTER successfully building the sof binary, only when it tries to build either bootloader, boot_module or base_module that actually need rimage: [ 87%] Performing configure step for 'rimage_ep' CMake Error: The source directory "/home/SOF/sof/rimage" does not appear to contain CMakeLists.txt. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
parent
39d5365fc7
commit
177d9bd073
|
@ -37,8 +37,11 @@ if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git")
|
||||||
# manually initializing rimage and _not_ some other
|
# manually initializing rimage and _not_ some other
|
||||||
# submodule. In that case you get the warning above.
|
# submodule. In that case you get the warning above.
|
||||||
|
|
||||||
message(STATUS "Git submodules update")
|
# TODO: get rid of this CMake configuration time
|
||||||
|
# hack. Downloading, configuring and building should always be
|
||||||
|
# kept separate; that's CI 101.
|
||||||
|
|
||||||
|
message(STATUS "Git submodules update HACK")
|
||||||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --merge --recursive
|
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --merge --recursive
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
RESULT_VARIABLE GIT_SUBMOD_RESULT)
|
RESULT_VARIABLE GIT_SUBMOD_RESULT)
|
||||||
|
@ -50,8 +53,3 @@ if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git")
|
||||||
endif() # rimage/CMakeLists.txt
|
endif() # rimage/CMakeLists.txt
|
||||||
|
|
||||||
endif() # .git/
|
endif() # .git/
|
||||||
|
|
||||||
# rimage is not optional, see "git grep include.*rimage"
|
|
||||||
if(NOT EXISTS "${RIMAGE_CMAKE}")
|
|
||||||
message(FATAL_ERROR "rimage not found! Please update git submodules and try again.")
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -256,6 +256,14 @@ add_custom_target(bin_extras)
|
||||||
|
|
||||||
if(build_bootloader)
|
if(build_bootloader)
|
||||||
add_executable(bootloader "")
|
add_executable(bootloader "")
|
||||||
|
|
||||||
|
add_dependencies(bootloader rimage_ep)
|
||||||
|
# This line should be next to the boot_module
|
||||||
|
# (resp. base_module) definitions but there are too many of
|
||||||
|
# them; one per platform. So do it only once here instead.
|
||||||
|
add_dependencies(boot_module rimage_ep)
|
||||||
|
add_dependencies(base_module rimage_ep)
|
||||||
|
|
||||||
target_link_libraries(bootloader PRIVATE sof_options)
|
target_link_libraries(bootloader PRIVATE sof_options)
|
||||||
add_local_sources(bootloader xtos/_vectors.S ${PROJECT_SOURCE_DIR}/src/platform/${family_path}/boot_entry.S ${PROJECT_SOURCE_DIR}/src/platform/${family_path}/boot_loader.c)
|
add_local_sources(bootloader xtos/_vectors.S ${PROJECT_SOURCE_DIR}/src/platform/${family_path}/boot_entry.S ${PROJECT_SOURCE_DIR}/src/platform/${family_path}/boot_loader.c)
|
||||||
target_link_libraries(bootloader PRIVATE reset)
|
target_link_libraries(bootloader PRIVATE reset)
|
||||||
|
@ -351,6 +359,7 @@ ExternalProject_Add(smex_ep
|
||||||
SOURCE_DIR "${PROJECT_SOURCE_DIR}/smex"
|
SOURCE_DIR "${PROJECT_SOURCE_DIR}/smex"
|
||||||
PREFIX "${PROJECT_BINARY_DIR}/smex_ep"
|
PREFIX "${PROJECT_BINARY_DIR}/smex_ep"
|
||||||
BINARY_DIR "${PROJECT_BINARY_DIR}/smex_ep/build"
|
BINARY_DIR "${PROJECT_BINARY_DIR}/smex_ep/build"
|
||||||
|
EXCLUDE_FROM_ALL TRUE
|
||||||
BUILD_ALWAYS 1
|
BUILD_ALWAYS 1
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
)
|
)
|
||||||
|
@ -372,6 +381,7 @@ ExternalProject_Add(rimage_ep
|
||||||
SOURCE_DIR "${PROJECT_SOURCE_DIR}/rimage"
|
SOURCE_DIR "${PROJECT_SOURCE_DIR}/rimage"
|
||||||
PREFIX "${PROJECT_BINARY_DIR}/rimage_ep"
|
PREFIX "${PROJECT_BINARY_DIR}/rimage_ep"
|
||||||
BINARY_DIR "${PROJECT_BINARY_DIR}/rimage_ep/build"
|
BINARY_DIR "${PROJECT_BINARY_DIR}/rimage_ep/build"
|
||||||
|
EXCLUDE_FROM_ALL TRUE
|
||||||
BUILD_ALWAYS 1
|
BUILD_ALWAYS 1
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue