~aleteoryx/muditaos

ref: 587915d5dac9c6dc6aed48be01b59ae4675d811a muditaos/cmake/modules/FetchBootloader.cmake -rw-r--r-- 803 bytes
587915d5 — Lucjan Bryndza [CP-330] Remove all remounts RW fat partition 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function(fetch_ecoboot)
    set(ECOBOOT_ASSET_NAME ecoboot.bin)
    if(${PURE_HW_TARGET} STREQUAL "T6")
        set(ECOBOOT_ASSET_NAME ecoboot_T6.bin)
    endif()

    add_custom_command(OUTPUT ecoboot.bin
        COMMAND ${CMAKE_SOURCE_DIR}/tools/download_asset.py
            "$<$<BOOL:$ENV{ASSETS_LOGIN}>:-l$ENV{ASSETS_LOGIN}>"
            "$<$<BOOL:$ENV{ASSETS_TOKEN}>:-t$ENV{ASSETS_TOKEN}>"
            -w ${CMAKE_BINARY_DIR}
            ecoboot download
            -n ${ECOBOOT_ASSET_NAME}
            -o ecoboot.bin
        COMMENT "Downloading ecoboot.bin"
        BYPRODUCTS ecoboot.version
    )

    add_custom_target(ecoboot.bin-target DEPENDS ecoboot.bin)

    multicomp_install(PROGRAMS ${CMAKE_BINARY_DIR}/ecoboot.bin DESTINATION "./"
        COMPONENTS Standalone Update)
endfunction()