Skip to content

Commit 50ad559

Browse files
author
Ace Zhao
committed
Merge remote-tracking branch 'upstream/master'
2 parents b8eff01 + 86fdb5b commit 50ad559

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

Diff for: Kconfig.projbuild

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ config ARDUHAL_PARTITION_SCHEME_MINIMAL
9090
bool "Minimal (for 2MB FLASH)"
9191
config ARDUHAL_PARTITION_SCHEME_NO_OTA
9292
bool "No OTA (for large apps)"
93+
config ARDUHAL_PARTITION_SCHEME_HUGE_APP
94+
bool "Huge App (for very large apps)"
9395
config ARDUHAL_PARTITION_SCHEME_MIN_SPIFFS
9496
bool "Minimal SPIFFS (for large apps with OTA)"
9597
endchoice
@@ -99,6 +101,7 @@ config ARDUHAL_PARTITION_SCHEME
99101
default "default" if ARDUHAL_PARTITION_SCHEME_DEFAULT
100102
default "minimal" if ARDUHAL_PARTITION_SCHEME_MINIMAL
101103
default "no_ota" if ARDUHAL_PARTITION_SCHEME_NO_OTA
104+
default "huge_app" if ARDUHAL_PARTITION_SCHEME_HUGE_APP
102105
default "min_spiffs" if ARDUHAL_PARTITION_SCHEME_MIN_SPIFFS
103106

104107

Diff for: component.mk

+33-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
1-
ARDUINO_LIBRARIES_LIST := $(patsubst $(COMPONENT_PATH)/libraries/%,%,$(wildcard $(COMPONENT_PATH)/libraries/*))
2-
ARDUINO_SINGLE_LIBRARY_FILES = $(patsubst $(COMPONENT_PATH)/%,%,$(sort $(dir $(wildcard $(COMPONENT_PATH)/libraries/$(MODULE)/*/)) $(dir $(wildcard $(COMPONENT_PATH)/libraries/$(MODULE)/*/*/)) $(dir $(wildcard $(COMPONENT_PATH)/libraries/$(MODULE)/*/*/*/)) $(dir $(wildcard $(COMPONENT_PATH)/libraries/$(MODULE)/*/*/*/*/)) $(dir $(wildcard $(COMPONENT_PATH)/libraries/$(MODULE)/*/*/*/*/*/))))
3-
ARDUINO_CORE_LIBS := $(foreach MODULE,$(ARDUINO_LIBRARIES_LIST),$(if $(CONFIG_ARDUINO_SELECTIVE_COMPILATION),$(if $(CONFIG_ARDUINO_SELECTIVE_$(MODULE)),$(ARDUINO_SINGLE_LIBRARY_FILES)),$(ARDUINO_SINGLE_LIBRARY_FILES)))
1+
ARDUINO_ALL_LIBRARIES := $(patsubst $(COMPONENT_PATH)/libraries/%,%,$(wildcard $(COMPONENT_PATH)/libraries/*))
42

5-
COMPONENT_ADD_INCLUDEDIRS := cores/esp32 variants/esp32 $(ARDUINO_CORE_LIBS)
3+
# Macro returns non-empty if Arduino library $(1) should be included in the build
4+
# (either because selective compilation is of, or this library is enabled
5+
define ARDUINO_LIBRARY_ENABLED
6+
$(if $(CONFIG_ARDUINO_SELECTIVE_COMPILATION),$(CONFIG_ARDUINO_SELECTIVE_$(1)),y)
7+
endef
8+
9+
ARDUINO_ENABLED_LIBRARIES := $(foreach LIBRARY,$(sort $(ARDUINO_ALL_LIBRARIES)),$(if $(call ARDUINO_LIBRARY_ENABLED,$(LIBRARY)),$(LIBRARY)))
10+
11+
$(info Arduino libraries in build: $(ARDUINO_ENABLED_LIBRARIES))
12+
13+
# Expand all subdirs under $(1)
14+
define EXPAND_SUBDIRS
15+
$(sort $(dir $(wildcard $(1)/* $(1)/*/* $(1)/*/*/* $(1)/*/*/*/* $(1)/*/*/*/*/*)))
16+
endef
17+
18+
# Macro returns SRCDIRS for library
19+
define ARDUINO_LIBRARY_GET_SRCDIRS
20+
$(if $(wildcard $(COMPONENT_PATH)/libraries/$(1)/src/.), \
21+
$(call EXPAND_SUBDIRS,$(COMPONENT_PATH)/libraries/$(1)/src), \
22+
$(filter-out $(call EXPAND_SUBDIRS,$(COMPONENT_PATH)/libraries/$(1)/examples), \
23+
$(call EXPAND_SUBDIRS,$(COMPONENT_PATH)/libraries/$(1)) \
24+
) \
25+
)
26+
endef
27+
28+
# Make a list of all srcdirs in enabled libraries
29+
ARDUINO_LIBRARY_SRCDIRS := $(patsubst $(COMPONENT_PATH)/%,%,$(foreach LIBRARY,$(ARDUINO_ENABLED_LIBRARIES),$(call ARDUINO_LIBRARY_GET_SRCDIRS,$(LIBRARY))))
30+
31+
#$(info Arduino libraries src dirs: $(ARDUINO_LIBRARY_SRCDIRS))
32+
33+
COMPONENT_ADD_INCLUDEDIRS := cores/esp32 variants/esp32 $(ARDUINO_LIBRARY_SRCDIRS)
634
COMPONENT_PRIV_INCLUDEDIRS := cores/esp32/libb64
7-
COMPONENT_SRCDIRS := cores/esp32/libb64 cores/esp32 variants/esp32 $(ARDUINO_CORE_LIBS)
35+
COMPONENT_SRCDIRS := cores/esp32/libb64 cores/esp32 variants/esp32 $(ARDUINO_LIBRARY_SRCDIRS)
836
CXXFLAGS += -fno-rtti

0 commit comments

Comments
 (0)