OVMS3-idf/components/bootloader/subproject/CMakeLists.txt
Angus Gratton 12be399762 cmake: Add link-time dependencies for linker script files
Requires some hackery around limitations in CMake's LINK_DEPENDS
2018-04-30 09:59:20 +10:00

20 lines
709 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()
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(MAIN_SRCS main/bootloader_start.c)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(bootloader)
target_linker_script(bootloader.elf "main/esp32.bootloader.ld")
target_linker_script(bootloader.elf "main/esp32.bootloader.rom.ld")
target_link_libraries(bootloader.elf "${BOOTLOADER_LINKER_ARGS}")
target_link_libraries(bootloader.elf gcc)