From 67ae353bfbb7afde841ee5f313a166cb0d681319 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sat, 20 Aug 2022 13:56:50 +0100 Subject: [PATCH] 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 --- tools/tplg_parser/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/tplg_parser/CMakeLists.txt b/tools/tplg_parser/CMakeLists.txt index 49e9029e8..e6b635a24 100644 --- a/tools/tplg_parser/CMakeLists.txt +++ b/tools/tplg_parser/CMakeLists.txt @@ -8,7 +8,13 @@ include(../../scripts/cmake/misc.cmake) 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 process.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. 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 -DCONFIG_LIBRARY -DCONFIG_IPC_MAJOR_3)