2019-07-12 12:32:30 +08:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2021-09-09 05:54:20 +08:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2019-07-12 12:32:30 +08:00
|
|
|
|
|
|
|
project(SOF_TPLG_PARSER C)
|
|
|
|
|
2022-02-22 21:54:13 +08:00
|
|
|
include(../../scripts/cmake/misc.cmake)
|
2023-03-02 23:26:15 +08:00
|
|
|
include(CheckCCompilerFlag)
|
2022-02-22 21:54:13 +08:00
|
|
|
|
2022-11-09 23:53:37 +08:00
|
|
|
set(default_asoc_h "/usr/include/alsa/sound/uapi/asoc.h")
|
|
|
|
|
2019-07-12 12:32:30 +08:00
|
|
|
set(sof_source_directory "${PROJECT_SOURCE_DIR}/../..")
|
|
|
|
|
2022-08-20 20:56:50 +08:00
|
|
|
if (CONFIG_LIBRARY_STATIC)
|
|
|
|
add_library(sof_tplg_parser STATIC "")
|
|
|
|
else()
|
|
|
|
add_library(sof_tplg_parser SHARED "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_sources(sof_tplg_parser PUBLIC
|
2022-02-22 21:54:13 +08:00
|
|
|
tokens.c
|
|
|
|
process.c
|
|
|
|
control.c
|
2023-08-09 06:08:12 +08:00
|
|
|
pcm.c
|
2022-02-22 21:54:13 +08:00
|
|
|
pga.c
|
|
|
|
mixer.c
|
|
|
|
pipeline.c
|
2023-08-09 03:42:31 +08:00
|
|
|
host.c
|
2022-02-22 21:54:13 +08:00
|
|
|
dai.c
|
2022-08-20 20:54:45 +08:00
|
|
|
asrc.c
|
|
|
|
src.c
|
|
|
|
buffer.c
|
|
|
|
graph.c
|
2023-01-03 05:00:25 +08:00
|
|
|
object.c
|
2023-08-05 07:19:00 +08:00
|
|
|
audio_formats.c
|
2022-02-22 21:54:13 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
sof_append_relative_path_definitions(sof_tplg_parser)
|
|
|
|
|
2019-07-12 12:32:30 +08:00
|
|
|
target_include_directories(sof_tplg_parser PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
|
|
target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/include)
|
2022-02-22 21:54:13 +08:00
|
|
|
target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/arch/host/include)
|
|
|
|
target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/platform/library/include)
|
2023-08-31 11:41:36 +08:00
|
|
|
target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/audio)
|
2023-08-31 06:03:58 +08:00
|
|
|
target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/posix/include)
|
2022-08-19 21:10:56 +08:00
|
|
|
|
2022-11-09 23:53:37 +08:00
|
|
|
# Configuration time, make copy
|
|
|
|
configure_file(${default_asoc_h} ${CMAKE_CURRENT_BINARY_DIR}/include/alsa/sound/asoc.h)
|
|
|
|
|
|
|
|
# Build time
|
|
|
|
target_include_directories(sof_tplg_parser PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/include")
|
|
|
|
|
2023-03-02 23:26:15 +08:00
|
|
|
# -Wimplicit-fallthrough is preferred, check if it's supported
|
|
|
|
check_c_compiler_flag(-Wimplicit-fallthrough supports_implicit_fallthrough)
|
|
|
|
if (supports_implicit_fallthrough)
|
|
|
|
set(implicit_fallthrough -Wimplicit-fallthrough)
|
|
|
|
endif()
|
|
|
|
|
2022-02-22 21:54:13 +08:00
|
|
|
# TODO: add IPC4 option when it's ready.
|
|
|
|
target_compile_options(sof_tplg_parser PRIVATE
|
2022-08-20 20:56:50 +08:00
|
|
|
-g -O -Wall -Werror -Wl,-EL -fPIC -DPIC
|
2023-03-02 23:26:15 +08:00
|
|
|
-Wmissing-prototypes ${implicit_fallthrough}
|
2022-02-22 21:54:13 +08:00
|
|
|
-DCONFIG_LIBRARY -DCONFIG_IPC_MAJOR_3)
|
|
|
|
|
|
|
|
target_link_libraries(sof_tplg_parser PRIVATE -lm)
|
2019-07-12 12:32:30 +08:00
|
|
|
|
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/tplg_parser
|
|
|
|
DESTINATION include
|
|
|
|
PATTERN "*.h"
|
|
|
|
)
|
|
|
|
|
|
|
|
install(TARGETS sof_tplg_parser DESTINATION lib)
|