Skip to content

Commit a1c870e

Browse files
Paul m. p. Pdpgeorge
Paul m. p. P
authored andcommitted
javascript: Enable support for frozen bytecode via FROZEN_MPY_DIR.
1 parent 42d30c5 commit a1c870e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ports/javascript/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ LDFLAGS = -m32 -Wl,-Map=$@.map,--cref -Wl,--gc-sections
2525
CFLAGS += -O0 -DNDEBUG
2626
CFLAGS += -fdata-sections -ffunction-sections
2727

28+
ifneq ($(FROZEN_MPY_DIR),)
29+
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
30+
# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
31+
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
32+
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
33+
endif
34+
2835
SRC_LIB = $(addprefix lib/,\
2936
utils/interrupt_char.c \
3037
utils/stdout_helpers.c \

0 commit comments

Comments
 (0)