Skip to content

Commit

Permalink
topology2: build only when alsatplg is v1.2.7 or greater
Browse files Browse the repository at this point in the history
Fixes: thesofproject#5323

The v1.2.6 requirement was a lie the whole time because alsatplg v1.2.6
does not have any `-I` option. The truth was: un-released alsa-utils
from git was required. The check for v1.2.6 was an approximation good
enough for many users but not for everyone, see for instance thesofproject#5323.

Now that alsa-utils v1.2.7 has been released we can stop lying:
 alsa-project/alsa-utils@7d934f3142549

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Aug 17, 2022
1 parent 6bea410 commit 6b96025
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/topology/topology2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# SPDX-License-Identifier: BSD-3-Clause
add_custom_target(topologies2)

# check alsatplg version and built topology2 if alsatplg version is 1.2.6 or greater
# 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)
message(WARNING "alsatplg error: ${STATUS}, topology2 will be skipped")
else()
string(REPLACE "\n" ";" ALSA_VERSION_LIST ${ALSA_VERSION})
list(GET ALSA_VERSION_LIST 0 ALSATPLG_VERSION)
string(REGEX MATCH "[0-9]\.[0-9]\.*[0-9]*" ALSATPLG_VERSION_NUMBER ${ALSATPLG_VERSION})
if(${ALSATPLG_VERSION_NUMBER} VERSION_LESS "1.2.6")
message(WARNING "topology2 will be skipped. Minimum required version for alsatplg: 1.2.6")
if(${ALSATPLG_VERSION_NUMBER} VERSION_LESS "1.2.7")
message(WARNING "topology2 will be skipped. Minimum required version for alsatplg: 1.2.7")
else()
add_dependencies(topologies topologies2)
endif()
Expand Down

0 comments on commit 6b96025

Please sign in to comment.