- matches.extend(Glob(root + '/' + pattern, ondisk, source, strings))
-
+ # This is a helper function to build Arduino libraries. Scripts are using this function
+ # to add all the files in a folder as compilation targets rather than specifying each
+ # file to compile from a Arduino library folder.
+
+ # Since the function is recursive, it adds even "/library/<library-name>/examples" to the
+ # compilation list. This is an extra overhead as stack is never going to use ".o" generated
+ # for these examples.
+ if 'examples' not in root:
+ matches.extend(Glob(root + '/' + pattern, ondisk, source, strings))