build system: Initial cmake support, work in progress

This commit is contained in:
Angus Gratton
2018-01-12 13:49:13 +11:00
committed by Angus Gratton
parent a538644560
commit c671a0c3eb
56 changed files with 1115 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
# TODO: add config stuff for bootloader here

View File

@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.5)
set(CMAKE_TOOLCHAIN_FILE $ENV{IDF_PATH}/toolchain.cmake)
project(idf_bootloader ASM C CXX)
set(COMPONENTS bootloader esptool_py esp32 soc bootloader_support log spi_flash micro-ecc soc)
set(BOOTLOADER_BUILD 1)
set(IS_BOOTLOADER_BUILD 1) # deprecated, use BOOTLOADER_BUILD
add_definitions(-DBOOTLOADER_BUILD=1)
if(NOT SDKCONFIG)
message(FATAL_ERROR "Bootloader subproject expects the SDKCONFIG variable to be passed in by the app build process.")
endif()
include($ENV{IDF_PATH}/idf.cmake)
add_executable(bootloader.elf
main/bootloader_start.c
main/flash_qio_mode.c)
target_link_libraries(bootloader.elf ${COMPONENT_LIBRARIES})
target_link_libraries(bootloader.elf "-L ${CMAKE_CURRENT_SOURCE_DIR}/main")
target_link_libraries(bootloader.elf "-T esp32.bootloader.ld")
target_link_libraries(bootloader.elf "-T esp32.bootloader.rom.ld")
target_link_libraries(bootloader.elf "${BOOTLOADER_LINKER_ARGS}")