mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ulp: check assembler version
This commit is contained in:
parent
81231fcc4b
commit
b35c745c4f
@ -3,6 +3,28 @@ cmake_minimum_required(VERSION 3.5)
|
|||||||
include(${IDF_PATH}/tools/cmake/utilities.cmake)
|
include(${IDF_PATH}/tools/cmake/utilities.cmake)
|
||||||
project(${ULP_APP_NAME} ASM C)
|
project(${ULP_APP_NAME} ASM C)
|
||||||
|
|
||||||
|
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 assembler \\(GNU Binutils\\) (${version_pattern})" as_version ${as_output})
|
||||||
|
set(as_version ${CMAKE_MATCH_1})
|
||||||
|
|
||||||
|
# Check the supported assembler version
|
||||||
|
file(STRINGS ${IDF_PATH}/components/ulp/toolchain_ulp_version.mk version_file_contents)
|
||||||
|
string(REGEX MATCH "SUPPORTED_ULP_ASSEMBLER_VERSION = (${version_pattern})" as_supported_version ${version_file_contents})
|
||||||
|
set(as_supported_version ${CMAKE_MATCH_1})
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
set(ULP_MAP_GEN ${IDF_PATH}/components/ulp/esp32ulp_mapgen.py)
|
set(ULP_MAP_GEN ${IDF_PATH}/components/ulp/esp32ulp_mapgen.py)
|
||||||
set(ULP_LD_TEMPLATE ${IDF_PATH}/components/ulp/ld/esp32.ulp.ld)
|
set(ULP_LD_TEMPLATE ${IDF_PATH}/components/ulp/ld/esp32.ulp.ld)
|
||||||
|
|
||||||
@ -71,7 +93,7 @@ add_custom_command( OUTPUT ${ULP_APP_NAME}.ld ${ULP_APP_NAME}.h
|
|||||||
# ULP files being built.
|
# ULP files being built.
|
||||||
add_custom_target(build
|
add_custom_target(build
|
||||||
DEPENDS ${ULP_APP_NAME} ${ULP_APP_NAME}.bin ${ULP_APP_NAME}.sym
|
DEPENDS ${ULP_APP_NAME} ${ULP_APP_NAME}.bin ${ULP_APP_NAME}.sym
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.ld
|
${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.ld
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.h
|
${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.h
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
@ -24,6 +24,16 @@ ULP_PREPROCESSOR_ARGS := \
|
|||||||
|
|
||||||
-include $(ULP_DEP)
|
-include $(ULP_DEP)
|
||||||
|
|
||||||
|
# Check the assembler version
|
||||||
|
include $(IDF_PATH)/components/ulp/toolchain_ulp_version.mk
|
||||||
|
ULP_AS_VER := $(shell $(ULP_AS) --version | sed -E -n 's|GNU assembler \(GNU Binutils\) ([a-z0-9\.-]+)|\1|gp')
|
||||||
|
|
||||||
|
ifeq (,$(findstring $(ULP_AS_VER), $(SUPPORTED_ULP_ASSEMBLER_VERSION)))
|
||||||
|
$(info WARNING: ULP assembler version $(ULP_AS_VER) is not supported.)
|
||||||
|
$(info Expected to see version: $(SUPPORTED_ULP_ASSEMBLER_VERSION))
|
||||||
|
$(info Please check ESP-IDF ULP setup instructions and update the toolchain, or proceed at your own risk.)
|
||||||
|
endif
|
||||||
|
|
||||||
# Preprocess LD script used to link ULP program
|
# Preprocess LD script used to link ULP program
|
||||||
$(ULP_LD_SCRIPT): $(ULP_LD_TEMPLATE)
|
$(ULP_LD_SCRIPT): $(ULP_LD_TEMPLATE)
|
||||||
$(summary) CPP $(patsubst $(PWD)/%,%,$(CURDIR))/$@
|
$(summary) CPP $(patsubst $(PWD)/%,%,$(CURDIR))/$@
|
||||||
|
1
components/ulp/toolchain_ulp_version.mk
Normal file
1
components/ulp/toolchain_ulp_version.mk
Normal file
@ -0,0 +1 @@
|
|||||||
|
SUPPORTED_ULP_ASSEMBLER_VERSION = 2.28.51.20170517
|
Loading…
Reference in New Issue
Block a user