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

@@ -24,24 +24,24 @@ else()
if(NOT CONFIG_NO_BLOBS)
target_link_libraries(esp32 coexist core espnow net80211 phy pp rtc smartconfig wpa2 wpa wps)
endif()
target_link_libraries(esp32 "-L ${CMAKE_CURRENT_SOURCE_DIR}/ld")
target_link_libraries(esp32 "-T ${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld")
target_link_libraries(esp32 "-T esp32.common.ld")
target_link_libraries(esp32 "-T esp32.rom.ld")
target_link_libraries(esp32 "-T esp32.peripherals.ld")
target_linker_script(esp32 "${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld")
target_linker_script(esp32 "ld/esp32.common.ld")
target_linker_script(esp32 "ld/esp32.rom.ld")
target_linker_script(esp32 "ld/esp32.peripherals.ld")
if(CONFIG_SPIRAM_CACHE_WORKAROUND)
add_compile_options(-mfix-esp32-psram-cache-issue)
else()
target_link_libraries(esp32 "-T esp32.rom.spiram_incompatible_fns.ld")
target_linker_script(esp32 "ld/esp32.rom.spiram_incompatible_fns.ld")
endif()
if(CONFIG_NEWLIB_NANO_FORMAT)
target_link_libraries(esp32 "-T esp32.rom.nanofmt.ld")
target_linker_script(esp32 "ld/esp32.rom.nanofmt.ld")
endif()
if(NOT CONFIG_SPI_FLASH_ROM_DRIVER_PATCH)
target_link_libraries(esp32 "-T esp32.rom.spiflash.ld")
target_linker_script(esp32 "ld/esp32.rom.spiflash.ld")
endif()
target_link_libraries(esp32 "${CMAKE_CURRENT_SOURCE_DIR}/libhal.a")