Skip to content

py/mkrules.mk: Make MICROPY_MODULE_FROZEN_STR conditional on compiler.#40

Draft
andrewleech wants to merge 1 commit intomasterfrom
pr/mkrules-frozen-str
Draft

py/mkrules.mk: Make MICROPY_MODULE_FROZEN_STR conditional on compiler.#40
andrewleech wants to merge 1 commit intomasterfrom
pr/mkrules-frozen-str

Conversation

@andrewleech
Copy link
Copy Markdown
Owner

Summary

When MICROPY_ENABLE_COMPILER=0 in a port/variant, freezing modules as source text (.py) cannot work because there is no runtime compiler to parse them. Defaults MICROPY_MODULE_FROZEN_STR to 0 in this case so the build only uses pre-compiled .mpy modules. Legacy behaviour is preserved when the compiler is enabled.

Also propagates MICROPY_ENABLE_COMPILER=0 to CFLAGS when explicitly set.

Testing

Unix build with default settings (no behaviour change); a variant build with MICROPY_ENABLE_COMPILER=0 (frozen-only) now succeeds.

When MICROPY_ENABLE_COMPILER is set to 0 in a port/variant, freezing
modules as source text (.py) cannot work because there is no runtime
compiler to parse them. Default MICROPY_MODULE_FROZEN_STR to 0 in this
case so the build only uses pre-compiled .mpy modules. The legacy
behaviour is preserved when the compiler is enabled.

Also propagate MICROPY_ENABLE_COMPILER=0 to CFLAGS when explicitly set,
so the C code can ifdef on it consistently.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants