topology2/cmake: stricter if execute_process(alsatplg --version ...)

We want to fail if STATUS is not defined, the empty string, the FALSE
string or anything unexpected that it is not strictly equal to success
code "0".

Fixes commit 308a24a92b ("topology2: Add build support")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2023-10-19 22:45:28 +00:00 committed by Liam Girdwood
parent 9e0f7eecec
commit ec1cfd8f95
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ add_custom_target(topologies2)
# Check alsatplg version and build topology2 if alsatplg version is
# 1.2.7 or greater, see https://github.com/thesofproject/sof/issues/5323
execute_process(COMMAND alsatplg --version RESULT_VARIABLE STATUS OUTPUT_VARIABLE ALSA_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
if(STATUS AND NOT STATUS EQUAL 0)
if(NOT STATUS EQUAL 0)
message(WARNING "alsatplg error: ${STATUS}, topology2 will be skipped")
else()
string(REPLACE "\n" ";" ALSA_VERSION_LIST ${ALSA_VERSION})