|
| 1 | +# SPDX-License-Identifier: BSD-3-Clause |
| 2 | +# |
| 3 | +# Copyright(c) 2026 Intel Corporation. |
| 4 | + |
| 5 | +cmake_minimum_required(VERSION 3.20.0) |
| 6 | + |
| 7 | +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) |
| 8 | +project(sof_unit_audio_selector) |
| 9 | + |
| 10 | +set(SOF_ROOT "${PROJECT_SOURCE_DIR}/../../../../../") |
| 11 | +set(sof_top_dir ${SOF_ROOT}) |
| 12 | + |
| 13 | +include(${SOF_ROOT}/scripts/cmake/misc.cmake) |
| 14 | +include(${SOF_ROOT}/scripts/cmake/uuid-registry.cmake) |
| 15 | + |
| 16 | +target_include_directories(app PRIVATE |
| 17 | + ${SOF_ROOT}/zephyr/include |
| 18 | + ${SOF_ROOT}/src/include |
| 19 | + ${SOF_ROOT}/src/kernel/platform/posix/include |
| 20 | + ${SOF_ROOT}/src/audio |
| 21 | + ${SOF_ROOT}/tools/rimage/src/include |
| 22 | + ${PROJECT_BINARY_DIR}/include/generated |
| 23 | +) |
| 24 | + |
| 25 | +target_compile_definitions(app PRIVATE |
| 26 | + -DCONFIG_ZEPHYR_POSIX=1 |
| 27 | + -DCONFIG_LIBRARY=1 |
| 28 | + -DUNIT_TEST=1 |
| 29 | +) |
| 30 | + |
| 31 | +target_sources(app PRIVATE |
| 32 | + selector_ztest.c |
| 33 | + ${SOF_ROOT}/test/ztest/unit/common/alloc.c |
| 34 | + ${SOF_ROOT}/test/ztest/unit/common/sof_context.c |
| 35 | + ${SOF_ROOT}/src/audio/selector/selector.c |
| 36 | + ${SOF_ROOT}/src/audio/selector/selector_generic.c |
| 37 | + ${SOF_ROOT}/src/audio/module_adapter/module_adapter.c |
| 38 | + ${SOF_ROOT}/src/audio/module_adapter/module_adapter_ipc4.c |
| 39 | + ${SOF_ROOT}/src/audio/module_adapter/module/generic.c |
| 40 | + ${SOF_ROOT}/src/audio/buffers/comp_buffer.c |
| 41 | + ${SOF_ROOT}/src/audio/buffers/audio_buffer.c |
| 42 | + ${SOF_ROOT}/src/audio/source_api_helper.c |
| 43 | + ${SOF_ROOT}/src/audio/sink_api_helper.c |
| 44 | + ${SOF_ROOT}/src/audio/sink_source_utils.c |
| 45 | + ${SOF_ROOT}/src/audio/audio_stream.c |
| 46 | + ${SOF_ROOT}/src/audio/component.c |
| 47 | + ${SOF_ROOT}/src/audio/data_blob.c |
| 48 | + ${SOF_ROOT}/src/module/audio/source_api.c |
| 49 | + ${SOF_ROOT}/src/module/audio/sink_api.c |
| 50 | + ${SOF_ROOT}/src/ipc/ipc4/helper.c |
| 51 | + ${SOF_ROOT}/src/ipc/ipc-common.c |
| 52 | + ${SOF_ROOT}/src/ipc/ipc-helper.c |
| 53 | + ${SOF_ROOT}/src/lib/objpool.c |
| 54 | + ${SOF_ROOT}/src/math/numbers.c |
| 55 | +) |
| 56 | + |
| 57 | +target_link_libraries(app PRIVATE |
| 58 | + "-Wl,--wrap=rzalloc,--wrap=rfree,--wrap=sof_heap_alloc,--wrap=sof_heap_free,--wrap=sof_sys_user_heap_get" |
| 59 | +) |
| 60 | + |
| 61 | +# The standalone target compiles the full IPC4 helper translation unit while |
| 62 | +# linking only its format helpers; other helper paths leave one local ID unused. |
| 63 | +set_source_files_properties( |
| 64 | + ${SOF_ROOT}/src/ipc/ipc4/helper.c |
| 65 | + PROPERTIES COMPILE_OPTIONS "-Wno-unused-variable" |
| 66 | +) |
| 67 | + |
| 68 | +sof_append_relative_path_definitions(app) |
0 commit comments