topology/cmake: skip all topologies when alsatplg < 1.2.5

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>
This commit is contained in:
Marc Herbert 2023-10-23 15:08:51 -07:00 committed by Kai Vehmanen
parent d9fb722b64
commit 1b1ec6c492
1 changed files with 19 additions and 0 deletions

View File

@ -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:
#