Merge branch 'bugfix/custom_bootloader_subproject_build_v3.2' into 'release/v3.2'

CMake: Fix custom bootloader does not override original (v3.2)

See merge request idf/esp-idf!5082
This commit is contained in:
Angus Gratton 2019-06-11 08:26:08 +08:00
commit 8b54542a88
2 changed files with 10 additions and 1 deletions

View file

@ -15,9 +15,10 @@ set(bootloader_binary_files
externalproject_add(bootloader
# TODO: support overriding the bootloader in COMPONENT_PATHS
SOURCE_DIR "${IDF_PATH}/components/bootloader/subproject"
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/subproject"
BINARY_DIR "${bootloader_build_dir}"
CMAKE_ARGS -DSDKCONFIG=${SDKCONFIG} -DIDF_PATH=${IDF_PATH}
-DEXTRA_COMPONENT_DIRS=${CMAKE_CURRENT_LIST_DIR}
INSTALL_COMMAND ""
BUILD_ALWAYS 1 # no easy way around this...
BUILD_BYPRODUCTS ${bootloader_binary_files}

View file

@ -250,6 +250,14 @@ EOF
export PATH="$OLDPATH"
rm ./python
print_status "Custom bootloader overrides original"
clean_build_dir
(mkdir components && cd components && cp -r $IDF_PATH/components/bootloader .)
idf.py build
grep "$PWD/components/bootloader/subproject/main/bootloader_start.c" build/bootloader/compile_commands.json \
|| failure "Custom bootloader source files should be built instead of the original's"
rm -rf components
print_status "All tests completed"
if [ -n "${FAILURES}" ]; then
echo "Some failures were detected:"