diff --git a/src/init/CMakeLists.txt b/src/init/CMakeLists.txt index 91c8bb5d9a61..a5799d4c476d 100644 --- a/src/init/CMakeLists.txt +++ b/src/init/CMakeLists.txt @@ -1,5 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause +if(CONFIG_SOF) ### Zephyr ### + + +zephyr_library_sources( + init.c + ext_manifest.c +) + + +else() ### Not Zephyr ### + + add_local_sources(sof init.c) add_library(ext_manifest STATIC "") @@ -21,3 +33,6 @@ sof_append_relative_path_definitions(ext_manifest) target_link_libraries(ext_manifest sof_options) target_link_libraries(sof_static_libraries INTERFACE ext_manifest) + + +endif() # Zephyr diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 37a51de920d9..418e5903b270 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -1,7 +1,7 @@ -# This is still WIP - Not fully validated on any platform. - # When west is installed, Zephyr's CMake invokes west to list and try to -# compile every Zephyr module that can be found. +# compile every Zephyr module that can be found. See +# sof/zephyr/module.yml and +# https://docs.zephyrproject.org/latest/develop/modules.html if(CONFIG_SOF) if(CONFIG_LIBRARY) @@ -114,6 +114,14 @@ zephyr_include_directories( # SOC level sources # Files that are commented may not be needed. + +# New, "de-centralized Zephyr" way. Requires "if(CONFIG_SOF)" conditionals in +# the decentralized CMakeLists.txt files shared with XTOS. +add_subdirectory(../src/init/ unused_install_init/) + + +# Old way below: all .c files added by this giant file. + # Intel TGL and CAVS 2.5 platforms if (CONFIG_SOC_SERIES_INTEL_CAVS_V25) @@ -344,8 +352,6 @@ zephyr_library_sources( ${SOF_AUDIO_PATH}/pipeline/pipeline-xrun.c # SOF core infrastructure - runs on top of Zephyr - ${SOF_SRC_PATH}/init/init.c - ${SOF_SRC_PATH}/init/ext_manifest.c ${SOF_SRC_PATH}/arch/xtensa/drivers/cache_attr.c ${SOF_SRC_PATH}/schedule/zephyr_domain.c ${SOF_SRC_PATH}/schedule/schedule.c