py: Expand lists in core cmake custom commands.

The core cmake rules use custom commands to invoke qstr processing
scripts. For the zephyr port, it's possible that list arguments to these
commands may contain generator expressions, therefore we need to expand
them properly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
Maureen Helm 2020-11-10 19:05:30 -06:00 committed by Damien George
parent 2aa57931a6
commit dff6fc64d2
1 changed files with 5 additions and 0 deletions

View File

@ -73,6 +73,7 @@ add_custom_command(
DEPENDS ${MICROPY_MODULEDEFS} DEPENDS ${MICROPY_MODULEDEFS}
${MICROPY_SOURCE_QSTR} ${MICROPY_SOURCE_QSTR}
VERBATIM VERBATIM
COMMAND_EXPAND_LISTS
) )
add_custom_command( add_custom_command(
@ -81,6 +82,7 @@ add_custom_command(
COMMAND touch ${MICROPY_QSTR_DEFS_SPLIT} COMMAND touch ${MICROPY_QSTR_DEFS_SPLIT}
DEPENDS ${MICROPY_QSTR_DEFS_LAST} DEPENDS ${MICROPY_QSTR_DEFS_LAST}
VERBATIM VERBATIM
COMMAND_EXPAND_LISTS
) )
add_custom_command( add_custom_command(
@ -88,6 +90,7 @@ add_custom_command(
COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py cat qstr _ ${MICROPY_GENHDR_DIR}/qstr ${MICROPY_QSTR_DEFS_COLLECTED} COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py cat qstr _ ${MICROPY_GENHDR_DIR}/qstr ${MICROPY_QSTR_DEFS_COLLECTED}
DEPENDS ${MICROPY_QSTR_DEFS_SPLIT} DEPENDS ${MICROPY_QSTR_DEFS_SPLIT}
VERBATIM VERBATIM
COMMAND_EXPAND_LISTS
) )
add_custom_command( add_custom_command(
@ -95,6 +98,7 @@ add_custom_command(
COMMAND cat ${MICROPY_PY_QSTRDEFS} ${MICROPY_QSTR_DEFS_COLLECTED} | sed "s/^Q(.*)/\"&\"/" | ${CMAKE_C_COMPILER} -E ${MICROPY_CPP_FLAGS} - | sed "s/^\\\"\\(Q(.*)\\)\\\"/\\1/" > ${MICROPY_QSTR_DEFS_PREPROCESSED} COMMAND cat ${MICROPY_PY_QSTRDEFS} ${MICROPY_QSTR_DEFS_COLLECTED} | sed "s/^Q(.*)/\"&\"/" | ${CMAKE_C_COMPILER} -E ${MICROPY_CPP_FLAGS} - | sed "s/^\\\"\\(Q(.*)\\)\\\"/\\1/" > ${MICROPY_QSTR_DEFS_PREPROCESSED}
DEPENDS ${MICROPY_QSTR_DEFS_COLLECTED} DEPENDS ${MICROPY_QSTR_DEFS_COLLECTED}
VERBATIM VERBATIM
COMMAND_EXPAND_LISTS
) )
add_custom_command( add_custom_command(
@ -102,6 +106,7 @@ add_custom_command(
COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdata.py ${MICROPY_QSTR_DEFS_PREPROCESSED} > ${MICROPY_QSTR_DEFS_GENERATED} COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdata.py ${MICROPY_QSTR_DEFS_PREPROCESSED} > ${MICROPY_QSTR_DEFS_GENERATED}
DEPENDS ${MICROPY_QSTR_DEFS_PREPROCESSED} DEPENDS ${MICROPY_QSTR_DEFS_PREPROCESSED}
VERBATIM VERBATIM
COMMAND_EXPAND_LISTS
) )
# Build frozen code if enabled # Build frozen code if enabled