Support cases where IDF_PATH may be passed in on the cmake command line, or inferred from a (hardcoded absolute or relative) path to project.cmake
30 lines
925 B
CMake
30 lines
925 B
CMake
cmake_minimum_required(VERSION 3.5)
|
|
|
|
if(NOT SDKCONFIG)
|
|
message(FATAL_ERROR "Bootloader subproject expects the SDKCONFIG variable to be passed "
|
|
"in by the parent build process.")
|
|
endif()
|
|
|
|
if(NOT IDF_PATH)
|
|
message(FATAL_ERROR "Bootloader subproject expects the IDF_PATH variable to be passed "
|
|
"in by the parent build process.")
|
|
endif()
|
|
|
|
set(COMPONENTS bootloader esptool_py esp32 soc bootloader_support log spi_flash micro-ecc soc)
|
|
set(BOOTLOADER_BUILD 1)
|
|
add_definitions(-DBOOTLOADER_BUILD=1)
|
|
|
|
set(COMPONENT_REQUIRES_COMMON log esp32 soc)
|
|
|
|
set(MAIN_SRCS main/bootloader_start.c)
|
|
|
|
include("${IDF_PATH}/tools/cmake/project.cmake")
|
|
project(bootloader)
|
|
|
|
target_linker_script(bootloader.elf
|
|
"main/esp32.bootloader.ld"
|
|
"main/esp32.bootloader.rom.ld")
|
|
# Imported from esp32 component
|
|
target_linker_script(bootloader.elf ${ESP32_BOOTLOADER_LINKER_SCRIPTS})
|
|
|
|
target_link_libraries(bootloader.elf gcc)
|