mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-11 07:11:59 +00:00
Merge branch 'feature/use_tools_json_to_check_toolchain_ver' into 'master'
Tools: use tools.json to double-check toolchain version when building See merge request espressif/esp-idf!19894
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
# Warn if the toolchain version doesn't match
|
||||
#
|
||||
if(NOT (${target} STREQUAL "linux" OR CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||
get_expected_ctng_version(expected_toolchain expected_gcc)
|
||||
gcc_version_check("${expected_gcc}")
|
||||
crosstool_version_check("${expected_toolchain}")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -dumpmachine
|
||||
OUTPUT_VARIABLE toolchain_name
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
check_expected_tool_version(${toolchain_name} ${CMAKE_C_COMPILER})
|
||||
endif()
|
||||
|
||||
if(NOT ${target} STREQUAL "linux" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
|
@@ -1,35 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
include(${IDF_PATH}/tools/cmake/utilities.cmake)
|
||||
include(${IDF_PATH}/tools/cmake/idf.cmake)
|
||||
project(${ULP_APP_NAME} ASM C)
|
||||
add_executable(${ULP_APP_NAME})
|
||||
|
||||
option(ULP_COCPU_IS_RISCV "Use RISC-V based ULP" OFF)
|
||||
|
||||
set(version_pattern "[a-z0-9\.-_]+")
|
||||
|
||||
# Check assembler version
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_ASM_COMPILER} --version
|
||||
OUTPUT_VARIABLE as_output
|
||||
ERROR_QUIET)
|
||||
|
||||
string(REGEX MATCH "\\(GNU Binutils\\) (${version_pattern})" as_version ${as_output})
|
||||
set(as_version ${CMAKE_MATCH_1})
|
||||
|
||||
|
||||
message(STATUS "Building ULP app ${ULP_APP_NAME}")
|
||||
|
||||
# Check the supported assembler version
|
||||
if(NOT ULP_COCPU_IS_RISCV)
|
||||
message(STATUS "ULP assembler version: ${as_version}")
|
||||
set(as_supported_version 2.35_20220830)
|
||||
|
||||
if(NOT as_version STREQUAL as_supported_version)
|
||||
message(WARNING "WARNING: ULP assembler version ${as_version} is not supported. Expected to see version: \
|
||||
${as_supported_version}. Please check ESP-IDF ULP setup instructions and update \
|
||||
the toolchain, or proceed at your own risk.")
|
||||
endif()
|
||||
check_expected_tool_version("esp32ulp-elf" ${CMAKE_ASM_COMPILER})
|
||||
endif()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user