diff --git a/scripts/build-tools.sh b/scripts/build-tools.sh index 658c2ed58cae..434109aba869 100755 --- a/scripts/build-tools.sh +++ b/scripts/build-tools.sh @@ -6,7 +6,6 @@ set -e SOF_TOP=$(cd "$(dirname "$0")/.." && pwd) -export ALSA_CONFIG_DIR="${SOF_TOP}"/tools/topology/topology2 print_usage() { diff --git a/tools/topology/CMakeLists.txt b/tools/topology/CMakeLists.txt index b10b96ce02ce..4b7b36d1a2a1 100644 --- a/tools/topology/CMakeLists.txt +++ b/tools/topology/CMakeLists.txt @@ -30,32 +30,21 @@ endmacro() macro(add_alsatplg2_command input_file output_file include_path) # command line definitions are optional - set (defines "") - set (optional_args ${ARGN}) - # Set defines if there is an optional argument - list(LENGTH optional_args optional_args_count) - if (${optional_args_count} GREATER 0) - list(GET optional_args 0 defines) + if (${ARGC} GREATER 3) + set (defines ${ARGV3}) + else() + set (defines "") endif() - if (defines STREQUAL "") - add_custom_command( - MAIN_DEPENDENCY ${input_file} - OUTPUT ${output_file} - # -p to pre-process Topology2.0 conf file - COMMAND alsatplg \$\${VERBOSE:+-v 1} -I ${include_path} -p -c ${input_file} -o ${output_file} - USES_TERMINAL - ) - else() - add_custom_command( - MAIN_DEPENDENCY ${input_file} - OUTPUT ${output_file} - # -p to pre-process Topology2.0 conf file - COMMAND alsatplg \$\${VERBOSE:+-v 1} -I ${include_path} -D ${defines} -p -c ${input_file} -o ${output_file} - USES_TERMINAL + add_custom_command( + MAIN_DEPENDENCY ${input_file} + OUTPUT ${output_file} + # -p to pre-process Topology2.0 conf file + COMMAND ALSA_CONFIG_DIR=${CMAKE_SOURCE_DIR}/topology/topology2 alsatplg \$\${VERBOSE:+-v 1} + -I ${include_path} -D "'${defines}'" -p -c ${input_file} -o ${output_file} + USES_TERMINAL ) - endif() endmacro() diff --git a/tools/topology/topology2/cavs/CMakeLists.txt b/tools/topology/topology2/cavs/CMakeLists.txt index 88c6ea9d7248..c4d5973da4af 100644 --- a/tools/topology/topology2/cavs/CMakeLists.txt +++ b/tools/topology/topology2/cavs/CMakeLists.txt @@ -37,6 +37,9 @@ foreach(tplg ${TPLGS}) endif() # copy ABI and input conf file contents + # + # BUG: move this from CMake configuration time to build time to + # fix incremental builds configure_file(${CMAKE_CURRENT_BINARY_DIR}/../abi.conf ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf) file(READ ${CMAKE_CURRENT_SOURCE_DIR}/${input}.conf CONTENTS) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf "${CONTENTS}") diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index b27109c4aa5f..4375266c9701 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -728,16 +728,8 @@ set(GENERATED_DIRECTORY ${PROJECT_BINARY_DIR}/include/generated) set(VERSION_H_PATH ${GENERATED_DIRECTORY}/sof_versions.h) -if(${CMAKE_VERSION} VERSION_LESS "3.12.0") - # FindPythonInterp is bugged and may sometimes be unable to find - # Python 3 when both Python 2 & 3 are in PATH, - # so it's always better to use CMake 3.12+ - find_package(PythonInterp 3.0) - set(PYTHON3 "${PYTHON_EXECUTABLE}") -else() - find_package(Python3 COMPONENTS Interpreter) - set(PYTHON3 "${Python3_EXECUTABLE}") -endif() +find_package(Python3 COMPONENTS Interpreter) +set(PYTHON3 "${Python3_EXECUTABLE}") # SOF uses GNU C99 extensions. TODO other flags required ? target_compile_options(SOF INTERFACE -std=gnu99 -fno-inline-functions)