Skip to content

Commit 1338207

Browse files
committed
zephyr: Update GOOGLE_RTC_AUDIO_PROCESSING
Unbreak the Zephyr build when this is enabled, and add the needed bits to produce a working executable. This is mostly just a recapitulation of the existing integration, which means that it's manually pulling in bits from the Cadence toolchain it needs. Really this is nothing more than a C++ library and it shouldn't have to do anything other than enable CONFIG_CPP=y in the build. But the upstream Zephyr C++ toolchain integration for xcc/xt-clang isn't present yet. Signed-off-by: Andy Ross <andyross@google.com>
1 parent 36a8987 commit 1338207

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

zephyr/CMakeLists.txt

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,6 @@ zephyr_library_sources_ifdef(CONFIG_COMP_MULTIBAND_DRC
837837
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc_generic.c
838838
)
839839

840-
zephyr_library_sources_ifdef(CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING
841-
${SOF_AUDIO_PATH}/google_rtc_audio_processing.c
842-
)
843-
844840
zephyr_library_sources_ifdef(CONFIG_COMP_IGO_NR
845841
${SOF_AUDIO_PATH}/igo_nr/igo_nr.c
846842
)
@@ -916,6 +912,29 @@ zephyr_library_sources_ifdef(CONFIG_DW_DMA
916912
${SOF_DRIVERS_PATH}/dw/dma.c
917913
)
918914

915+
if(CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING)
916+
zephyr_library_sources(${SOF_AUDIO_PATH}/google/google_rtc_audio_processing.c)
917+
zephyr_library_sources_ifdef(CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK
918+
${SOF_AUDIO_PATH}/google/google_rtc_audio_processing_mock.c)
919+
zephyr_include_directories(../third_party/include)
920+
target_link_directories(SOF INTERFACE ../third_party/lib)
921+
target_link_libraries(SOF INTERFACE google_rtc_audio_processing)
922+
923+
# This isn't quite right, Zephyr should be providing a C++
924+
# linkage environment for the toolchain, but the xcc/xt-clang
925+
# integration isn't yet. Note we need to specify libc/libm
926+
# because the Cadence C++ standard library is tightly coupled
927+
# to their own libc (which is just a newlib). And I have NO
928+
# idea why libgcc isn't on the link currently, that's a Zephyr
929+
# mistake and I guess I'm surprised nothing else has broken.
930+
# Needs to be cleaned up Zephyr-side.
931+
target_link_libraries(SOF INTERFACE c++)
932+
target_link_libraries(SOF INTERFACE c++abi)
933+
target_link_libraries(SOF INTERFACE m)
934+
target_link_libraries(SOF INTERFACE c)
935+
target_link_libraries(SOF INTERFACE gcc)
936+
endif()
937+
919938
zephyr_library_link_libraries(SOF)
920939
target_link_libraries(SOF INTERFACE zephyr_interface)
921940

0 commit comments

Comments
 (0)