Skip to content

Commit 141f7d0

Browse files
Gadgetoiddpgeorge
authored andcommitted
py/mkrules.cmake: Clean genhdr and frozen_mpy dirs.
CMake builds relied upon the parent Makefile removing the entire build directory to successfully clean build artifacts. py/mkrules.cmake: Add ADDITIONAL_CLEAN_FILES properties to ensure a "make clean" from within the build directory removes the genhdr and frozen_mpy directories. Signed-off-by: Phil Howard <github@gadgetoid.com>
1 parent 0615d13 commit 141f7d0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

py/mkrules.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ if(MICROPY_ROM_TEXT_COMPRESSION)
100100
)
101101
endif()
102102

103+
# Ensure genhdr directory is removed on clean
104+
105+
set_property(TARGET ${MICROPY_TARGET} APPEND PROPERTY ADDITIONAL_CLEAN_FILES
106+
"${MICROPY_GENHDR_DIR}"
107+
)
108+
103109
# Command to force the build of another command
104110

105111
# Generate mpversion.h
@@ -244,6 +250,10 @@ add_custom_command(
244250
if(MICROPY_FROZEN_MANIFEST)
245251
set(MICROPY_FROZEN_CONTENT "${CMAKE_BINARY_DIR}/frozen_content.c")
246252

253+
set_property(TARGET ${MICROPY_TARGET} APPEND PROPERTY ADDITIONAL_CLEAN_FILES
254+
"${CMAKE_BINARY_DIR}/frozen_mpy"
255+
)
256+
247257
target_sources(${MICROPY_TARGET} PRIVATE
248258
${MICROPY_FROZEN_CONTENT}
249259
)

0 commit comments

Comments
 (0)