8000 rp2/CMakeLists: Use MICROPY_BOARD_DIR to find pins.csv. · sylvinus/micropython@932f76c · GitHub
[go: up one dir, main page]

Skip to content

Commit 932f76c

Browse files
Gadgetoiddpgeorge
authored andcommitted
rp2/CMakeLists: Use MICROPY_BOARD_DIR to find pins.csv 8000 .
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>
1 parent a84c7a0 commit 932f76c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

ports/rp2/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,15 +530,14 @@ endforeach()
530530
# Include the main MicroPython cmake rules.
531531
include(${MICROPY_DIR}/py/mkrules.cmake)
532532

533-
set(MICROPY_BOARDS_DIR "${MICROPY_PORT_DIR}/boards")
534-
set(GEN_PINS_AF_CSV "${MICROPY_BOARDS_DIR}/rp2_af.csv")
535-
set(GEN_PINS_PREFIX "${MICROPY_BOARDS_DIR}/rp2_prefix.c")
536-
set(GEN_PINS_MKPINS "${MICROPY_BOARDS_DIR}/make-pins.py")
533+
set(GEN_PINS_AF_CSV "${MICROPY_PORT_DIR}/boards/rp2_af.csv")
534+
set(GEN_PINS_PREFIX "${MICROPY_PORT_DIR}/boards/rp2_prefix.c")
535+
set(GEN_PINS_MKPINS "${MICROPY_PORT_DIR}/boards/make-pins.py")
537536
set(GEN_PINS_SRC "${CMAKE_BINARY_DIR}/pins_${MICROPY_BOARD}.c")
538537
set(GEN_PINS_HDR "${MICROPY_GENHDR_DIR}/pins.h")
539538

540-
if(EXISTS "${MICROPY_BOARDS_DIR}/${MICROPY_BOARD}/pins.csv")
541-
set(GEN_PINS_BOARD_CSV "${MICROPY_BOARDS_DIR}/${MICROPY_BOARD}/pins.csv")
539+
if(EXISTS "${MICROPY_BOARD_DIR}/pins.csv")
540+
set(GEN_PINS_BOARD_CSV "${MICROPY_BOARD_DIR}/pins.csv")
542541
set(GEN_PINS_CSV_ARG --board-csv "${GEN_PINS_BOARD_CSV}")
543542
endif()
544543

0 commit comments

Comments
 (0)
0