mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
py/modsys: Add sys.implementation._build entry.
For a given MicroPython firmware/executable it can be sometimes important to know how it was built, which variant/board configuration it came from. This commit adds a new field `sys.implementation._build` that can help identify the configuration that MicroPython was built with. For now it's either: * <VARIANT> for unix, webassembly and windows ports * <BOARD>-<VARIANT> for microcontroller ports (the variant is optional) In the future additional elements may be added to this string, separated by a hyphen. Resolves issue #16498. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -27,6 +27,17 @@ OBJ_EXTRA_ORDER_DEPS += $(HEADER_BUILD)/compressed.data.h
|
||||
CFLAGS += -DMICROPY_ROM_TEXT_COMPRESSION=1
|
||||
endif
|
||||
|
||||
# Set the variant or board name.
|
||||
ifneq ($(VARIANT),)
|
||||
CFLAGS += -DMICROPY_BOARD_BUILD_NAME=\"$(VARIANT)\"
|
||||
else ifneq ($(BOARD),)
|
||||
ifeq ($(BOARD_VARIANT),)
|
||||
CFLAGS += -DMICROPY_BOARD_BUILD_NAME=\"$(BOARD)\"
|
||||
else
|
||||
CFLAGS += -DMICROPY_BOARD_BUILD_NAME=\"$(BOARD)-$(BOARD_VARIANT)\"
|
||||
endif
|
||||
endif
|
||||
|
||||
# QSTR generation uses the same CFLAGS, with these modifications.
|
||||
QSTR_GEN_FLAGS = -DNO_QSTR
|
||||
# Note: := to force evaluation immediately.
|
||||
|
||||
Reference in New Issue
Block a user