cmake: Add link-time dependencies for linker script files

Requires some hackery around limitations in CMake's LINK_DEPENDS
This commit is contained in:
Angus Gratton
2018-03-01 17:02:08 +11:00
committed by Angus Gratton
parent bc1693aae3
commit 12be399762
4 changed files with 52 additions and 11 deletions

View File

@@ -14,8 +14,7 @@ set(MAIN_SRCS main/bootloader_start.c)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(bootloader)
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_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)