@@ -152,10 +152,12 @@ CPPFLAGS += $(EXTRA_CPPFLAGS)
152152CPPFLAGS += -D ARDUINO=100 -D UNIX_HOST_DUINO -D EPOXY_DUINO -D $(EPOXY_CORE )
153153# Add the header files for the Core files.
154154CPPFLAGS += -I$(EPOXY_CORE_PATH )
155- # Add the header files for libraries. Old Arduino libraries place the header
156- # and source files right at the top. New Arduino libraries tend to use the
157- # ./src/ subdirectory. We need to support both.
158- CPPFLAGS_EXPANSION = -I$(module ) -I$(module ) /src
155+ # Add the header files for libraries. Old Arduino libraries (v1.0) place the
156+ # header and source files right at the top, or in a subdirectory named
157+ # 'utility'. New Arduino libraries (v1.5) place all their files recursively
158+ # under the ./src/ subdirectory. We need to support both. See details at:
159+ # https://arduino.github.io/arduino-cli/1.0/library-specification/ .
160+ CPPFLAGS_EXPANSION = -I$(module ) -I$(module ) /src -I$(module ) /utility
159161CPPFLAGS += $(foreach module,$(EPOXY_MODULES ) ,$(CPPFLAGS_EXPANSION ) )
160162
161163# Linker settings (e.g. -lm).
@@ -176,11 +178,13 @@ EPOXY_SRCS := $(wildcard $(EPOXY_CORE_PATH)/*.cpp) \
176178# Later Arduino libraries put the source files under the src/ directory. Also
177179# support 3 levels of subdirectories. Support both C and C++ libraries files.
178180MODULE_EXPANSION_CPP = $(wildcard $(module ) /* .cpp) \
181+ $(wildcard $(module ) /utility/* .cpp) \
179182 $(wildcard $(module ) /src/* .cpp) \
180183 $(wildcard $(module ) /src/* /* .cpp) \
181184 $(wildcard $(module ) /src/* /* /* .cpp) \
182185 $(wildcard $(module ) /src/* /* /* /* .cpp)
183186MODULE_EXPANSION_C = $(wildcard $(module ) /* .c) \
187+ $(wildcard $(module ) /utility/* .c) \
184188 $(wildcard $(module ) /src/* .c) \
185189 $(wildcard $(module ) /src/* /* .c) \
186190 $(wildcard $(module ) /src/* /* /* .c) \
0 commit comments