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
27 changes: 27 additions & 0 deletions tools/topology/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
set(SOF_TOPOLOGY_BINARY_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")

# This use of VERBOSE relies on original CMake behavior.
# From the add_custom_command() manual:
#
# Use of VERBATIM is recommended as it enables correct behavior.
# When VERBATIM is not given the behavior is platform specific because
# there is no protection of tool-specific special characters.
#
# This is fine because:
# - We don't expect alsatplg to work on Windows any time soon.
# - CMake is too afraid to remove the original, no-VERBATIM behavior:
# https://gitlab.kitware.com/cmake/cmake/issues/18849
#
# Also note that in alsa-utils commit v1.2.2~15-gcbabe7a3f0cc, alsatplg
# (accidentally?) started ignoring the verbosity level, now it's just
# verbose or not.
macro(add_alsatplg_command)
add_custom_command(
MAIN_DEPENDENCY ${ARGV0}
OUTPUT ${ARGV1}
# Use a redirection to work around hardcoded alsatplg permissions,
# see bug https://github.com/alsa-project/alsa-utils/issues/126
COMMAND alsatplg \$\${VERBOSE:+-v 1} -c ${ARGV0} -o - > ${ARGV1}
USES_TERMINAL
)
endmacro()


add_custom_target(topologies ALL)
add_dependencies(topologies topologies1)

Expand Down
22 changes: 1 addition & 21 deletions tools/topology/topology1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,27 +239,7 @@ foreach(tplg ${TPLGS})
USES_TERMINAL
)

# This use of VERBOSE relies on original CMake behavior.
# From the add_custom_command() manual:
#
# Use of VERBATIM is recommended as it enables correct behavior.
# When VERBATIM is not given the behavior is platform specific because
# there is no protection of tool-specific special characters.
#
# This is fine because:
# - We don't expect alsatplg to work on Windows any time soon.
# - CMake is too afraid to remove the original, no-VERBATIM behavior:
# https://gitlab.kitware.com/cmake/cmake/issues/18849
#
# Also note that in alsa-utils commit v1.2.2~15-gcbabe7a3f0cc, alsatplg
# (accidentally?) started ignoring the verbosity level, now it's just
# verbose or not.
add_custom_command(
OUTPUT production/${output}.tplg
COMMAND alsatplg \$\${VERBOSE:+-v 1} -c production/${output}.conf -o production/${output}.tplg
MAIN_DEPENDENCY production/${output}.conf
USES_TERMINAL
)
add_alsatplg_command(production/${output}.conf production/${output}.tplg)

add_custom_target(topology1_${output} DEPENDS production/${output}.tplg)
add_dependencies(topologies1 topology1_${output})
Expand Down
29 changes: 2 additions & 27 deletions tools/topology/topology1/development/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,7 @@ foreach(tplg ${TPLGS})
USES_TERMINAL
)

# This use of VERBOSE relies on original CMake behavior.
# From the add_custom_command() manual:
#
# Use of VERBATIM is recommended as it enables correct behavior.
# When VERBATIM is not given the behavior is platform specific because
# there is no protection of tool-specific special characters.
#
# This is fine because:
# - We don't expect alsatplg to work on Windows any time soon.
# - CMake is too afraid to remove the original, no-VERBATIM behavior:
# https://gitlab.kitware.com/cmake/cmake/issues/18849
#
# Also note that in alsa-utils commit v1.2.2~15-gcbabe7a3f0cc, alsatplg
# (accidentally?) started ignoring the verbosity level, now it's just
# verbose or not.
add_custom_command(
OUTPUT ${output}.tplg
COMMAND alsatplg \$\${VERBOSE:+-v 1} -c ${output}.conf -o ${output}.tplg
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf
USES_TERMINAL
)
add_alsatplg_command(${output}.conf ${output}.tplg)

add_custom_target(topology_${output} DEPENDS ${output}.tplg)
add_dependencies(dev_topologies1 topology_${output})
Expand Down Expand Up @@ -134,12 +114,7 @@ foreach(tplg ${TPLGS_UP})
VERBATIM
USES_TERMINAL
)
add_custom_command(
OUTPUT ${output}.tplg
COMMAND alsatplg \$\${VERBOSE:+-v 1} -c ${output}.conf -o ${output}.tplg
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf
USES_TERMINAL
)
add_alsatplg_command(${output}.conf ${output}.tplg)

add_custom_target(topology_${output} DEPENDS ${output}.tplg)
add_dependencies(dev_topologies1 topology_${output})
Expand Down
22 changes: 1 addition & 21 deletions tools/topology/topology1/dsp_enhancement/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,7 @@ foreach(tplg ${TPLGS_UP})
USES_TERMINAL
)

# This use of VERBOSE relies on original CMake behavior.
# From the add_custom_command() manual:
#
# Use of VERBATIM is recommended as it enables correct behavior.
# When VERBATIM is not given the behavior is platform specific because
# there is no protection of tool-specific special characters.
#
# This is fine because:
# - We don't expect alsatplg to work on Windows any time soon.
# - CMake is too afraid to remove the original, no-VERBATIM behavior:
# https://gitlab.kitware.com/cmake/cmake/issues/18849
#
# Also note that in alsa-utils commit v1.2.2~15-gcbabe7a3f0cc, alsatplg
# (accidentally?) started ignoring the verbosity level, now it's just
# verbose or not.
add_custom_command(
OUTPUT ${output}.tplg
COMMAND alsatplg \$\${VERBOSE:+-v 1} -c ${output}.conf -o ${output}.tplg
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf
USES_TERMINAL
)
add_alsatplg_command(${output}.conf ${output}.tplg)

add_custom_target(topology_${output} DEPENDS ${output}.tplg)
add_dependencies(dsp_topologies1 topology_${output})
Expand Down