Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/build-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
set -e

SOF_TOP=$(cd "$(dirname "$0")/.." && pwd)
export ALSA_CONFIG_DIR="${SOF_TOP}"/tools/topology/topology2

print_usage()
{
Expand Down
33 changes: 11 additions & 22 deletions tools/topology/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,21 @@ endmacro()

macro(add_alsatplg2_command input_file output_file include_path)
# command line definitions are optional
set (defines "")
set (optional_args ${ARGN})

# Set defines if there is an optional argument
list(LENGTH optional_args optional_args_count)
if (${optional_args_count} GREATER 0)
list(GET optional_args 0 defines)
if (${ARGC} GREATER 3)
set (defines ${ARGV3})
else()
set (defines "")
endif()

if (defines STREQUAL "")
add_custom_command(
MAIN_DEPENDENCY ${input_file}
OUTPUT ${output_file}
# -p to pre-process Topology2.0 conf file
COMMAND alsatplg \$\${VERBOSE:+-v 1} -I ${include_path} -p -c ${input_file} -o ${output_file}
USES_TERMINAL
)
else()
add_custom_command(
MAIN_DEPENDENCY ${input_file}
OUTPUT ${output_file}
# -p to pre-process Topology2.0 conf file
COMMAND alsatplg \$\${VERBOSE:+-v 1} -I ${include_path} -D ${defines} -p -c ${input_file} -o ${output_file}
USES_TERMINAL
add_custom_command(
MAIN_DEPENDENCY ${input_file}
OUTPUT ${output_file}
# -p to pre-process Topology2.0 conf file
COMMAND ALSA_CONFIG_DIR=${CMAKE_SOURCE_DIR}/topology/topology2 alsatplg \$\${VERBOSE:+-v 1}
-I ${include_path} -D "'${defines}'" -p -c ${input_file} -o ${output_file}
USES_TERMINAL
)
endif()
endmacro()


Expand Down
3 changes: 3 additions & 0 deletions tools/topology/topology2/cavs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ foreach(tplg ${TPLGS})
endif()

# copy ABI and input conf file contents
#
# BUG: move this from CMake configuration time to build time to
# fix incremental builds
configure_file(${CMAKE_CURRENT_BINARY_DIR}/../abi.conf ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/${input}.conf CONTENTS)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf "${CONTENTS}")
Expand Down
12 changes: 2 additions & 10 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -728,16 +728,8 @@ set(GENERATED_DIRECTORY ${PROJECT_BINARY_DIR}/include/generated)

set(VERSION_H_PATH ${GENERATED_DIRECTORY}/sof_versions.h)

if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
# FindPythonInterp is bugged and may sometimes be unable to find
# Python 3 when both Python 2 & 3 are in PATH,
# so it's always better to use CMake 3.12+
find_package(PythonInterp 3.0)
set(PYTHON3 "${PYTHON_EXECUTABLE}")
else()
find_package(Python3 COMPONENTS Interpreter)
set(PYTHON3 "${Python3_EXECUTABLE}")
endif()
find_package(Python3 COMPONENTS Interpreter)
set(PYTHON3 "${Python3_EXECUTABLE}")

# SOF uses GNU C99 extensions. TODO other flags required ?
target_compile_options(SOF INTERFACE -std=gnu99 -fno-inline-functions)
Expand Down