diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 6011a711..e01804b1 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -288,17 +288,15 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914 # end internal prototypes deplibs = _get_dep_libs(src_dir) - env.Prepend( - CPPPATH=[join("$BUILD_DIR", l) for (l, _) in deplibs] - ) - - # add automatically "utility" dir from the lib (Arduino issue) - env.Prepend( - CPPPATH=[ - join("$BUILD_DIR", l, "utility") for (l, ld) in deplibs - if isdir(join(ld, "utility")) - ] - ) + for l, ld in deplibs: + env.Prepend( + CPPPATH=[join("$BUILD_DIR", l)] + ) + # add automatically "utility" dir from the lib (Arduino issue) + if isdir(join(ld, "utility")): + env.Prepend( + CPPPATH=[join("$BUILD_DIR", l, "utility")] + ) libs = [] for (libname, inc_dir) in deplibs: