cmake: don't search for toolchain files in component directory

This feature was added when we thought that target components might be
added out of IDF tree. That never became possible, and with recent
changes in IDF architecture it is unlikely that this feature will be
necessary any time soon. Remove it, simplifying the code.
This commit is contained in:
Ivan Grokhotkov 2021-09-10 18:49:45 +02:00
parent 14e600801e
commit 06c0b8a5d0
2 changed files with 1 additions and 19 deletions

View File

@ -446,12 +446,6 @@ function run_tests()
mv CMakeLists.bak CMakeLists.txt
assert_built ${APP_BINS} ${BOOTLOADER_BINS} ${PARTITION_BIN}
print_status "Can find toolchain file in component directory"
clean_build_dir
mv ${IDF_PATH}/tools/cmake/toolchain-esp32.cmake ${IDF_PATH}/components/esp32/
(idf.py reconfigure > /dev/null && grep "${IDF_PATH}/components/esp32/toolchain-esp32.cmake" build/CMakeCache.txt) || failure "Failed to find toolchain file in component directory"
mv ${IDF_PATH}/components/esp32/toolchain-esp32.cmake ${IDF_PATH}/tools/cmake/
print_status "Setting EXTRA_COMPONENT_DIRS works"
clean_build_dir
(idf.py reconfigure | grep "$PWD/main") || failure "Failed to verify original `main` directory"

View File

@ -78,18 +78,6 @@ macro(__target_set_toolchain)
if(EXISTS ${toolchain_file_global})
set(CMAKE_TOOLCHAIN_FILE ${toolchain_file_global})
else()
__component_get_target(component_target ${IDF_TARGET})
if(NOT component_target)
message(FATAL_ERROR "Unable to resolve '${IDF_TARGET}' for setting toolchain file.")
endif()
get_property(component_dir TARGET ${component_target} PROPERTY COMPONENT_DIR)
# Try to load the toolchain file from the directory of IDF_TARGET component
set(toolchain_file_component ${component_dir}/toolchain-${IDF_TARGET}.cmake)
if(EXISTS ${toolchain_file_component})
set(CMAKE_TOOLCHAIN_FILE ${toolchain_file_component})
else()
message(FATAL_ERROR "Toolchain file toolchain-${IDF_TARGET}.cmake not found,"
"checked ${toolchain_file_global} and ${toolchain_file_component}")
endif()
message(FATAL_ERROR "Toolchain file ${toolchain_file_global} not found")
endif()
endmacro()