mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-02 08:01:43 +01:00
cmake: Refactor bootloader_subproject into the bootloader component itself
This commit is contained in:
committed by
Angus Gratton
parent
674d398c93
commit
3fac2b2ddc
31
components/bootloader/project_include.cmake
Normal file
31
components/bootloader/project_include.cmake
Normal file
@@ -0,0 +1,31 @@
|
||||
if(IS_BOOTLOADER_BUILD)
|
||||
return() # don't keep recursing!
|
||||
endif()
|
||||
|
||||
# Glue to build the bootloader subproject binary as an external
|
||||
# cmake project under this one
|
||||
#
|
||||
#
|
||||
set(bootloader_build_dir "${CMAKE_BINARY_DIR}/bootloader")
|
||||
set(bootloader_binary_files
|
||||
"${bootloader_build_dir}/bootloader.elf"
|
||||
"${bootloader_build_dir}/bootloader.bin"
|
||||
"${bootloader_build_dir}/bootloader.map"
|
||||
)
|
||||
|
||||
ExternalProject_Add(bootloader
|
||||
# TODO: support overriding the bootloader in COMPONENT_PATHS
|
||||
SOURCE_DIR "${IDF_PATH}/components/bootloader/subproject"
|
||||
BINARY_DIR "${bootloader_build_dir}"
|
||||
CMAKE_ARGS -DSDKCONFIG=${SDKCONFIG} -DIDF_PATH="${IDF_PATH}"
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_ALWAYS 1 # no easy way around this...
|
||||
BUILD_BYPRODUCTS ${bootloader_binary_files}
|
||||
)
|
||||
|
||||
# this is a hack due to an (annoying) shortcoming in cmake, it can't
|
||||
# extend the 'clean' target to the external project
|
||||
# see thread: https://cmake.org/pipermail/cmake/2016-December/064660.html
|
||||
#
|
||||
# So for now we just have the top-level build remove the final build products...
|
||||
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${bootloader_binary_files})
|
||||
@@ -12,8 +12,7 @@ set(BOOTLOADER_BUILD 1)
|
||||
set(IS_BOOTLOADER_BUILD 1) # deprecated, use BOOTLOADER_BUILD
|
||||
add_definitions(-DBOOTLOADER_BUILD=1)
|
||||
|
||||
set(MAIN_SRCS main/bootloader_start.c
|
||||
main/flash_qio_mode.c)
|
||||
set(MAIN_SRCS main/bootloader_start.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user