2 return() # don't keep recursing!
5 # Glue to build the bootloader subproject binary as an external
6 # cmake project under this one
9 set(bootloader_build_dir "${CMAKE_BINARY_DIR}/bootloader")
10 set(bootloader_binary_files
11 "${bootloader_build_dir}/bootloader.elf"
12 "${bootloader_build_dir}/bootloader.bin"
13 "${bootloader_build_dir}/bootloader.map"
16 externalproject_add(bootloader
17 # TODO: support overriding the bootloader in COMPONENT_PATHS
18 SOURCE_DIR "${IDF_PATH}/components/bootloader/subproject"
19 BINARY_DIR "${bootloader_build_dir}"
20 CMAKE_ARGS -DSDKCONFIG=${SDKCONFIG} -DIDF_PATH=${IDF_PATH}
22 BUILD_ALWAYS 1 # no easy way around this...
23 BUILD_BYPRODUCTS ${bootloader_binary_files}
26 # this is a hack due to an (annoying) shortcoming in cmake, it can't
27 # extend the 'clean' target to the external project
28 # see thread: https://cmake.org/pipermail/cmake/2016-December/064660.html
30 # So for now we just have the top-level build remove the final build products...
31 set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
32 ADDITIONAL_MAKE_CLEAN_FILES
33 ${bootloader_binary_files})