mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
modules: Use the default optimization level for all user C modules.
By appending the optimization level to modules CFLAGS. Note this works because according to the man page: If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.
This commit is contained in:
parent
5fe32bdc8a
commit
85db1a229c
@ -83,6 +83,7 @@ else
|
||||
DEBUG=0
|
||||
ROM_TEXT_COMPRESSION = 1
|
||||
CFLAGS += -O2 -DNDEBUG
|
||||
USERMOD_OPT = -O2
|
||||
MPY_CFLAGS += -DMICROPY_ROM_TEXT_COMPRESSION=1
|
||||
endif
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ export CFLAGS
|
||||
export AFLAGS
|
||||
export LDFLAGS
|
||||
export MPY_CFLAGS
|
||||
export USERMOD_OPT
|
||||
|
||||
# Export variables
|
||||
export TARGET
|
||||
|
||||
@ -38,3 +38,8 @@ ifeq ($(MICROPY_PY_ULAB), 1)
|
||||
USERMOD_DIR := $(USERMOD_DIR)/ulab/code
|
||||
include $(USERMOD_DIR)/micropython.mk
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 0)
|
||||
# Use a higher optimization level for user C modules.
|
||||
$(BUILD)/modules/%.o: override CFLAGS += $(USERMOD_OPT)
|
||||
endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user