rp2: Allow Overriding cmake frozen manifest from the command line.

If MICROPY_FROZEN_MANIFEST is set from the cmake command line, then it will
override the default and any manifest set by the board.
This commit is contained in:
iabdalkader 2022-03-09 23:28:52 +02:00 committed by Damien George
parent fe8b47e29f
commit df86cef59a

View File

@ -33,7 +33,9 @@ if(NOT EXISTS ${MICROPY_BOARD_DIR}/mpconfigboard.cmake)
message(FATAL_ERROR "Invalid MICROPY_BOARD specified: ${MICROPY_BOARD}") message(FATAL_ERROR "Invalid MICROPY_BOARD specified: ${MICROPY_BOARD}")
endif() endif()
# Include board config set(MICROPY_USER_FROZEN_MANIFEST ${MICROPY_FROZEN_MANIFEST})
# Include board config, it may override MICROPY_FROZEN_MANIFEST
include(${MICROPY_BOARD_DIR}/mpconfigboard.cmake) include(${MICROPY_BOARD_DIR}/mpconfigboard.cmake)
# Set the PICO_BOARD if it's not already set (allow a board to override it). # Set the PICO_BOARD if it's not already set (allow a board to override it).
@ -216,9 +218,13 @@ if (MICROPY_PY_NETWORK_NINAW10)
) )
endif() endif()
# Define mpy-cross flags and frozen manifest # Define mpy-cross flags
set(MICROPY_CROSS_FLAGS -march=armv7m) set(MICROPY_CROSS_FLAGS -march=armv7m)
if (NOT MICROPY_FROZEN_MANIFEST)
# Set the frozen manifest file
if (MICROPY_USER_FROZEN_MANIFEST)
set(MICROPY_FROZEN_MANIFEST ${MICROPY_USER_FROZEN_MANIFEST})
elseif (NOT MICROPY_FROZEN_MANIFEST)
set(MICROPY_FROZEN_MANIFEST ${PROJECT_SOURCE_DIR}/boards/manifest.py) set(MICROPY_FROZEN_MANIFEST ${PROJECT_SOURCE_DIR}/boards/manifest.py)
endif() endif()