Propogate changed pico_cmake_set_default values to the compilation #2034
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, if you compile with
-DPICO_FLASH_SIZE_BYTES="(2 * 1024 * 1024)"
, that modified flash size is only used in CMake (when generating the linker script) and doesn't propogate through to the compilation. To set it for the compilation you need to add a separatetarget_compile_definitions(my_exe INTERFACE PICO_FLASH_SIZE_BYTES=${PICO_FLASH_SIZE_BYTES})
to your CMakeLists.txt file.This PR changes this behaviour, so
pico_cmake_set_default
values that have been overridden (eg with-DPICO_...
orset(PICO_...)
will propogate through to the compilation. If the default value isn't modified then the behaviour is not changed, and you can still usetarget_compile_definitions
to set the values for compilation only.Adds a PICO_BOARD_CMAKE_OVERRIDES common scope variable, to contain any pico_cmake_set_default CMake variables which have been overwritten. This is populated when reading the board header, and then read when compiling
pico_base_headers
.Also add
pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
to board headers to enable/disable the E10 abs-block fix, and modifycheck_board_header.py
to support this. This allows specifying-DPICO_RP2350_A2_SUPPORTED=0
to CMake to prevent the creation of an abs_block, for example this could be used when you are not planning on dragging & dropping your UF2 into partition tables.