Skip to content
Permalink
Browse files

Lib/MicroPython: Add support for QSTR extraction

  • Loading branch information...
oliviermartin committed Feb 25, 2017
1 parent ede16a9 commit 5e5ee79bbce0e5c0cd3ce331d8363993eee1578b
Showing with 10 additions and 1 deletion.
  1. +7 −1 Lib/MicroPython/CMakeLists.txt
  2. +3 −0 Lib/MicroPython/Makefile
@@ -71,8 +71,14 @@ foreach(dir ${dirs})
set(LIBMICROPYTHON_CFLAGS "${LIBMICROPYTHON_CFLAGS} -I${dir}")
endforeach()

# List files for QSTR extraction
set(SOURCE_QSTR "")
foreach(_src ${micropython_lib_SRCS})
set(SOURCE_QSTR "${SOURCE_QSTR} ${CMAKE_CURRENT_SOURCE_DIR}/${_src}")
endforeach()

add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/libmicropython.a
COMMAND make V=1 CC=${CMAKE_C_COMPILER} CFLAGS=${LIBMICROPYTHON_CFLAGS} libmicropython.a
COMMAND make V=1 CC=${CMAKE_C_COMPILER} CFLAGS=${LIBMICROPYTHON_CFLAGS} SOURCE_QSTR=${SOURCE_QSTR} libmicropython.a
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${micropython_lib_SRCS} mpconfigport.h
COMMENT "Build MicroPython main library"
@@ -6,6 +6,9 @@ QSTR_DEFS = qstrdefsport.h
# include py core make definitions
include src/py/py.mk

# List of sources for qstr extraction
SRC_QSTR += $(SOURCE_QSTR)

OBJ = $(PY_O)

$(BUILD)/_frozen_mpy.c: frozentest.mpy $(BUILD)/genhdr/qstrdefs.generated.h

0 comments on commit 5e5ee79

Please sign in to comment.
You can’t perform that action at this time.