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 authored and kv2019i committed Oct 24, 2023
1 parent d9fb722 commit 1b1ec6c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tools/topology/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ ${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 failed: ${STATUS}; all topologies skipped")
return()
else()
if(${ALSATPLG_VERSION_NUMBER} VERSION_LESS "1.2.5")
message(WARNING "All topologies skipped: minimum alsatplg version 1.2.5,\
found ${ALSATPLG_VERSION_NUMBER}.")
return()
endif()
# success
endif()


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

0 comments on commit 1b1ec6c

Please sign in to comment.