Skip to content

Commit

Permalink
topology/cmake: skip all topologies when alsatplg < 1.2.5
Browse files Browse the repository at this point in the history
Stop producing corrupted .tplg files when using `codec_consumer` (e.g.:
sof-imx8mp-btsco-dual-8ch.tplg, sof-imx8ulp-9x9-btsco-16k.tplg, ...)

Then we'll be able to finally search/replace "codec_master", see revert

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb committed Oct 23, 2023
1 parent 1242b23 commit 6f99adb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tools/topology/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ ${stdout}")
endfunction()


# Being written in C, `alsatplg` silently ignores some invalid inputs
# and produces an corrupt .tplg file instead of returning an error code
# that fails the build. For instance, alsatplg versions < 1.2.5 silently
# corrupt `codec_consumer` and turn it into `codec_master` instead.
# Longer story in #5192.
alsatplg_version(STATUS ALSATPLG_VERSION_NUMBER)
if(NOT STATUS EQUAL 0)
message(WARNING "alsatplg error: ${STATUS}; topologies will be skipped")
else()
if(${ALSATPLG_VERSION_NUMBER} VERSION_LESS "1.2.5")
message(WARNING "topologies skipped. Minimum alsatplg version 1.2.5,\
found ${ALSATPLG_VERSION_NUMBER}.")
return()
endif()
endif()


# This use of VERBOSE relies on original CMake behavior.
# From the add_custom_command() manual:
#
Expand Down

0 comments on commit 6f99adb

Please sign in to comment.