From 06c0b8a5d08f02a89f1f3032d1f00995107d8be1 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 10 Sep 2021 18:49:45 +0200 Subject: [PATCH] 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. --- tools/ci/test_build_system_cmake.sh | 6 ------ tools/cmake/targets.cmake | 14 +------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index b864c03c2c..14f54ca70d 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -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" diff --git a/tools/cmake/targets.cmake b/tools/cmake/targets.cmake index 07651f0c6e..23d3ff4848 100644 --- a/tools/cmake/targets.cmake +++ b/tools/cmake/targets.cmake @@ -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()