]> granicus.if.org Git - esp-idf/blob - components/bootloader/subproject/CMakeLists.txt
cmake: Fix issues when IDF_PATH is not set in environment
[esp-idf] / components / bootloader / subproject / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.5)
2
3 if(NOT SDKCONFIG)
4     message(FATAL_ERROR "Bootloader subproject expects the SDKCONFIG variable to be passed "
5         "in by the parent build process.")
6 endif()
7
8 if(NOT IDF_PATH)
9     message(FATAL_ERROR "Bootloader subproject expects the IDF_PATH variable to be passed "
10         "in by the parent build process.")
11 endif()
12
13 set(COMPONENTS bootloader esptool_py esp32 soc bootloader_support log spi_flash micro-ecc soc)
14 set(BOOTLOADER_BUILD 1)
15 add_definitions(-DBOOTLOADER_BUILD=1)
16
17 set(COMPONENT_REQUIRES_COMMON log esp32 soc)
18
19 set(MAIN_SRCS main/bootloader_start.c)
20
21 include("${IDF_PATH}/tools/cmake/project.cmake")
22 project(bootloader)
23
24 target_linker_script(bootloader.elf
25     "main/esp32.bootloader.ld"
26     "main/esp32.bootloader.rom.ld")
27 # Imported from esp32 component
28 target_linker_script(bootloader.elf ${ESP32_BOOTLOADER_LINKER_SCRIPTS})
29
30 target_link_libraries(bootloader.elf gcc)