summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian 'redbeard' Harrington <redbeard@dead-city.org>2023-06-12 13:15:56 -0700
committerBrian 'redbeard' Harrington <redbeard@dead-city.org>2023-06-13 00:11:06 -0700
commitea8f0fd8965f24e5c9978a4078e377d2a0480908 (patch)
tree356ac41bdfcf9da912ede95456efe175363fb712
parent5fe2a3f14f8f60a536c5db12826ef2c3a8921951 (diff)
rp2/CMake: Normalize MICROPY_PORT_DIR.
In 5fe2a3f1 the ESP32 port underwent a change to how `MICROPY_PORT_DIR` is defined. This commit normalizes the `rp2` port to use the same underlying variable mechanism (`CMAKE_CURRENT_LIST_DIR`). Signed-off-by: Brian 'redbeard' Harrington <redbeard@dead-city.org>
-rw-r--r--ports/rp2/CMakeLists.txt36
1 files changed, 18 insertions, 18 deletions
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt
index 55c542173..72f44b19e 100644
--- a/ports/rp2/CMakeLists.txt
+++ b/ports/rp2/CMakeLists.txt
@@ -20,7 +20,7 @@ set(PICO_TINYUSB_PATH ${MICROPY_DIR}/lib/tinyusb)
set(PICO_LWIP_PATH ${MICROPY_DIR}/lib/lwip)
# Set the location of this port's directory.
-set(MICROPY_PORT_DIR ${CMAKE_SOURCE_DIR})
+set(MICROPY_PORT_DIR ${CMAKE_CURRENT_LIST_DIR})
# Set the board if it's not already set.
if(NOT MICROPY_BOARD)
@@ -80,7 +80,7 @@ include(${MICROPY_DIR}/py/usermod.cmake)
add_executable(${MICROPY_TARGET})
set(MICROPY_QSTRDEFS_PORT
- ${PROJECT_SOURCE_DIR}/qstrdefsport.h
+ ${MICROPY_PORT_DIR}/qstrdefsport.h
)
set(MICROPY_SOURCE_LIB
@@ -146,20 +146,20 @@ set(MICROPY_SOURCE_QSTR
${MICROPY_DIR}/shared/readline/readline.c
${MICROPY_DIR}/shared/runtime/mpirq.c
${MICROPY_DIR}/shared/runtime/sys_stdio_mphal.c
- ${PROJECT_SOURCE_DIR}/machine_adc.c
- ${PROJECT_SOURCE_DIR}/machine_i2c.c
- ${PROJECT_SOURCE_DIR}/machine_i2s.c
- ${PROJECT_SOURCE_DIR}/machine_pin.c
- ${PROJECT_SOURCE_DIR}/machine_rtc.c
- ${PROJECT_SOURCE_DIR}/machine_spi.c
- ${PROJECT_SOURCE_DIR}/machine_timer.c
- ${PROJECT_SOURCE_DIR}/machine_uart.c
- ${PROJECT_SOURCE_DIR}/machine_wdt.c
- ${PROJECT_SOURCE_DIR}/modmachine.c
- ${PROJECT_SOURCE_DIR}/modrp2.c
- ${PROJECT_SOURCE_DIR}/modos.c
- ${PROJECT_SOURCE_DIR}/rp2_flash.c
- ${PROJECT_SOURCE_DIR}/rp2_pio.c
+ ${MICROPY_PORT_DIR}/machine_adc.c
+ ${MICROPY_PORT_DIR}/machine_i2c.c
+ ${MICROPY_PORT_DIR}/machine_i2s.c
+ ${MICROPY_PORT_DIR}/machine_pin.c
+ ${MICROPY_PORT_DIR}/machine_rtc.c
+ ${MICROPY_PORT_DIR}/machine_spi.c
+ ${MICROPY_PORT_DIR}/machine_timer.c
+ ${MICROPY_PORT_DIR}/machine_uart.c
+ ${MICROPY_PORT_DIR}/machine_wdt.c
+ ${MICROPY_PORT_DIR}/modmachine.c
+ ${MICROPY_PORT_DIR}/modrp2.c
+ ${MICROPY_PORT_DIR}/modos.c
+ ${MICROPY_PORT_DIR}/rp2_flash.c
+ ${MICROPY_PORT_DIR}/rp2_pio.c
${CMAKE_BINARY_DIR}/pins_${MICROPY_BOARD}.c
)
@@ -343,7 +343,7 @@ set(MICROPY_CROSS_FLAGS -march=armv6m)
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 ${MICROPY_PORT_DIR}/boards/manifest.py)
endif()
target_sources(${MICROPY_TARGET} PRIVATE
@@ -362,7 +362,7 @@ target_include_directories(${MICROPY_TARGET} PRIVATE
${MICROPY_INC_CORE}
${MICROPY_INC_USERMOD}
${MICROPY_BOARD_DIR}
- "${PROJECT_SOURCE_DIR}"
+ "${MICROPY_PORT_DIR}"
"${CMAKE_BINARY_DIR}"
)