Skip to content

Commit

Permalink
ipc/cmake: use the new add_local_sources() indirection layer
Browse files Browse the repository at this point in the history
In the review of commit 1bd9e0d ("cmake/zephyr: decentralize
src/ipc/"), Andy recommended "maybe work around this by adding yet
another layer of indirection". I rejected the idea at the time because
the level of duplication in the ipc/ directory was small. Then I looked
at the bigger math/ subdirectory and I realized in #8548 that such an
indirection layer is actually required for bigger and/or more complex
cases. So I added that layer of indirection in commit
330d73e ("cmake: a few new add_local_sources[_ifdef]()
compatibility macros")

Now that we have it, we might as well use it and perform small
simplifications in ipc/cmake.

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Nov 29, 2023
1 parent 5cf1c9c commit efbe978
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
8 changes: 2 additions & 6 deletions src/ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ elseif (CONFIG_IPC_MAJOR_4)
add_subdirectory(ipc4)
endif()

set(base_files
# Common to Zephyr and XTOS
add_local_sources(sof
ipc-common.c
ipc-helper.c
)
Expand All @@ -15,7 +16,6 @@ is_zephyr(it_is)
if(it_is) ### Zephyr ###

zephyr_library_sources(
${base_files}
dma-copy.c
)

Expand All @@ -29,10 +29,6 @@ endif()
else() ### Not Zephyr ###


add_local_sources(sof
${base_files}
)

if (CONFIG_TRACE)
add_local_sources(sof
dma-copy.c)
Expand Down
8 changes: 2 additions & 6 deletions src/ipc/ipc3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

set(common_files
# Files common to Zephyr and XTOS
add_local_sources(sof
handler.c
helper.c
dai.c
Expand All @@ -10,16 +11,11 @@ is_zephyr(it_is)
if(it_is) ### Zephyr ###

zephyr_library_sources(
${common_files}
host-page-table.c
)

else() ### Not Zephyr ###

add_local_sources(sof
${common_files}
)

if (CONFIG_HOST_PTABLE)
add_local_sources(sof
host-page-table.c)
Expand Down
9 changes: 2 additions & 7 deletions src/ipc/ipc4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

set(common_files
# Files common to Zephyr and XTOS
add_local_sources(sof
dai.c
handler.c
helper.c
Expand All @@ -12,11 +13,6 @@ set(common_files
is_zephyr(it_is)
if(it_is) ### Zephyr ###


zephyr_library_sources(
${common_files}
)

zephyr_library_sources_ifdef(CONFIG_AMS
ams_helpers.c
)
Expand All @@ -26,7 +22,6 @@ else() ### Not Zephyr ####


add_local_sources(sof
${common_files}
ams_helpers.c
)

Expand Down

0 comments on commit efbe978

Please sign in to comment.