Skip to content

Commit adf4d19

Browse files
committed
library-manager: make disabling INTEL_MODULES possible
IADK is rarely needed, but when enabled it adds C++ objects to the build, while otherwise builds are pure C. Disabling INTEL_MODULES however is currently broken. Fix it to make modular builds without IADK support possible. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent fc9edf7 commit adf4d19

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

src/audio/module_adapter/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,20 @@ if(zephyr) ### Zephyr ###
2525
zephyr_library_import(xa_mp3_enc ${CONFIG_CADENCE_CODEC_MP3_ENC_LIB})
2626
endif()
2727

28-
zephyr_include_directories_ifdef(CONFIG_INTEL_MODULES
28+
zephyr_include_directories_ifdef(CONFIG_LIBRARY_MANAGER
2929
${SOF_SRC_PATH}/include/sof/audio/module_adapter/iadk/
3030
${SOF_SRC_PATH}/include/sof/audio/module_adapter/library/
3131
)
3232

33+
zephyr_library_sources_ifdef(CONFIG_LIBRARY_MANAGER
34+
library/native_system_agent.c
35+
)
36+
3337
zephyr_library_sources_ifdef(CONFIG_INTEL_MODULES
3438
module/modules.c
3539
iadk/module_initial_settings_concrete.cpp
3640
iadk/iadk_module_adapter.cpp
3741
iadk/system_agent.cpp
38-
library/native_system_agent.c
3942
library/native_system_service.c
4043
)
4144

src/include/sof/audio/module_adapter/library/native_system_service.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define NATIVE_SYSTEM_SERVICE_H
88

99
#include <stdint.h>
10-
#include <adsp_stddef.h>
1110

1211
#ifdef __cplusplus
1312
extern "C" {

src/library_manager/lib_manager.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ const struct sof_man_module *lib_manager_get_module_manifest(const uint32_t modu
485485
SOF_MAN_MODULE_OFFSET(entry_index));
486486
}
487487

488-
#if CONFIG_INTEL_MODULES
489488
/*
490489
* \brief Load module code, allocate its instance and create a module adapter component.
491490
* \param[in] drv - component driver pointer.
@@ -584,7 +583,9 @@ static void lib_manager_prepare_module_adapter(struct comp_driver *drv, const st
584583
drv->ops.dai_ts_start = module_adapter_ts_start_op;
585584
drv->ops.dai_ts_stop = module_adapter_ts_stop_op;
586585
drv->ops.dai_ts_get = module_adapter_ts_get_op;
586+
#if CONFIG_INTEL_MODULES
587587
drv->adapter_ops = &processing_module_adapter_interface;
588+
#endif
588589
}
589590

590591
int lib_manager_register_module(const uint32_t component_id)
@@ -649,7 +650,8 @@ int lib_manager_register_module(const uint32_t component_id)
649650
build_info->format);
650651

651652
/* Check if module is IADK */
652-
if (build_info->format == IADK_MODULE_API_BUILD_INFO_FORMAT &&
653+
if (IS_ENABLED(CONFIG_INTEL_MODULES) &&
654+
build_info->format == IADK_MODULE_API_BUILD_INFO_FORMAT &&
653655
build_info->api_version_number.full == IADK_MODULE_API_CURRENT_VERSION) {
654656
/* Use module_adapter functions */
655657
drv->ops.create = module_adapter_new;
@@ -679,14 +681,6 @@ int lib_manager_register_module(const uint32_t component_id)
679681
return ret;
680682
}
681683

682-
#else /* CONFIG_INTEL_MODULES */
683-
int lib_manager_register_module(const uint32_t component_id)
684-
{
685-
tr_err(&lib_manager_tr, "Dynamic module loading is not supported");
686-
return -ENOTSUP;
687-
}
688-
#endif /* CONFIG_INTEL_MODULES */
689-
690684
static int lib_manager_dma_buffer_alloc(struct lib_manager_dma_ext *dma_ext,
691685
uint32_t size)
692686
{

0 commit comments

Comments
 (0)