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 <damien@micropython.org>
pull/6845/head
Damien George 2021-02-05 01:10:30 +11:00
rodzic c891190c69
commit 1f800cac3c
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -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}
)