tplg_parser: support building as static or shared library.

Allow the tplg_parser to built as either static or shared library.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Liam Girdwood 2022-08-20 13:56:50 +01:00 committed by Liam Girdwood
parent d9f9340e1a
commit 67ae353bfb
1 changed files with 8 additions and 2 deletions

View File

@ -8,7 +8,13 @@ include(../../scripts/cmake/misc.cmake)
set(sof_source_directory "${PROJECT_SOURCE_DIR}/../..") set(sof_source_directory "${PROJECT_SOURCE_DIR}/../..")
add_library(sof_tplg_parser SHARED if (CONFIG_LIBRARY_STATIC)
add_library(sof_tplg_parser STATIC "")
else()
add_library(sof_tplg_parser SHARED "")
endif()
target_sources(sof_tplg_parser PUBLIC
tokens.c tokens.c
process.c process.c
control.c control.c
@ -32,7 +38,7 @@ target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/p
# TODO: add IPC4 option when it's ready. # TODO: add IPC4 option when it's ready.
target_compile_options(sof_tplg_parser PRIVATE target_compile_options(sof_tplg_parser PRIVATE
-g -O -Wall -Werror -Wl,-EL -g -O -Wall -Werror -Wl,-EL -fPIC -DPIC
-Wmissing-prototypes -Wimplicit-fallthrough -Wmissing-prototypes -Wimplicit-fallthrough
-DCONFIG_LIBRARY -DCONFIG_IPC_MAJOR_3) -DCONFIG_LIBRARY -DCONFIG_IPC_MAJOR_3)