diff options
| author | Phil Howard <phil@gadgetoid.com> | 2024-02-27 10:19:35 +0000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-06-03 16:26:08 +1000 |
| commit | 932f76c6ba64c5a3e68de3324556d9979f09303b (patch) | |
| tree | 00069a86508c807ceea9d7c418c287e9f1857579 | |
| parent | a84c7a0ed931667cda44a8e27888f066e085d5eb (diff) | |
rp2/CMakeLists: Use MICROPY_BOARD_DIR to find pins.csv.
Assuming that ${MICROPY_PORT_DIR}/boards/${MICROPY_BOARD} is equal to
${MICROPY_BOARD_DIR} is not valid, because the latter could point to a path
outside the main MicroPython repository.
Replace this path with the canonical ${MICROPY_BOARD_DIR} so that pins.csv
is correctly located when building against out-of-tree board definitions.
Additionally remove MICROPY_BOARDS_DIR to discourage similar mistakes.
Signed-off-by: Phil Howard <phil@gadgetoid.com>
| -rw-r--r-- | ports/rp2/CMakeLists.txt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt index f86224a5c..d3ecee586 100644 --- a/ports/rp2/CMakeLists.txt +++ b/ports/rp2/CMakeLists.txt @@ -530,15 +530,14 @@ endforeach() # Include the main MicroPython cmake rules. include(${MICROPY_DIR}/py/mkrules.cmake) -set(MICROPY_BOARDS_DIR "${MICROPY_PORT_DIR}/boards") -set(GEN_PINS_AF_CSV "${MICROPY_BOARDS_DIR}/rp2_af.csv") -set(GEN_PINS_PREFIX "${MICROPY_BOARDS_DIR}/rp2_prefix.c") -set(GEN_PINS_MKPINS "${MICROPY_BOARDS_DIR}/make-pins.py") +set(GEN_PINS_AF_CSV "${MICROPY_PORT_DIR}/boards/rp2_af.csv") +set(GEN_PINS_PREFIX "${MICROPY_PORT_DIR}/boards/rp2_prefix.c") +set(GEN_PINS_MKPINS "${MICROPY_PORT_DIR}/boards/make-pins.py") set(GEN_PINS_SRC "${CMAKE_BINARY_DIR}/pins_${MICROPY_BOARD}.c") set(GEN_PINS_HDR "${MICROPY_GENHDR_DIR}/pins.h") -if(EXISTS "${MICROPY_BOARDS_DIR}/${MICROPY_BOARD}/pins.csv") - set(GEN_PINS_BOARD_CSV "${MICROPY_BOARDS_DIR}/${MICROPY_BOARD}/pins.csv") +if(EXISTS "${MICROPY_BOARD_DIR}/pins.csv") + set(GEN_PINS_BOARD_CSV "${MICROPY_BOARD_DIR}/pins.csv") set(GEN_PINS_CSV_ARG --board-csv "${GEN_PINS_BOARD_CSV}") endif() |
