From 1f800cac3c4f56418486f24c3824418a890f759f Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 5 Feb 2021 01:10:30 +1100 Subject: [PATCH] rp2/micropy_rules.cmake: Fix makemoduledefs vpath to work with abs path. In particular the firmware can now be built in a build directory that lives outside the source tree, and the py/modarray.c file will still be found. See issue #6837. Signed-off-by: Damien George --- ports/rp2/micropy_rules.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/rp2/micropy_rules.cmake b/ports/rp2/micropy_rules.cmake index ade9b8c92d..9eee4ac14d 100644 --- a/ports/rp2/micropy_rules.cmake +++ b/ports/rp2/micropy_rules.cmake @@ -24,11 +24,10 @@ add_custom_command( ) # Generate moduledefs.h -# This is currently hard-coded to support modarray.c only, because makemoduledefs.py doesn't support absolute paths add_custom_command( OUTPUT ${MPY_MODULEDEFS} - COMMAND python3 ${MPY_PY_DIR}/makemoduledefs.py --vpath="." ../../../py/modarray.c > ${MPY_MODULEDEFS} + COMMAND python3 ${MPY_PY_DIR}/makemoduledefs.py --vpath="/" ${SOURCE_QSTR} > ${MPY_MODULEDEFS} DEPENDS ${MPY_MPVERSION} ${SOURCE_QSTR} )