@@ -99,6 +99,7 @@ import (
99
99
"os/exec"
100
100
"time"
101
101
102
+ "github.com/arduino/arduino-cli/arduino/libraries"
102
103
"github.com/arduino/arduino-cli/legacy/builder/builder_utils"
103
104
"github.com/arduino/arduino-cli/legacy/builder/constants"
104
105
"github.com/arduino/arduino-cli/legacy/builder/i18n"
@@ -127,6 +128,7 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
127
128
return err
128
129
}
129
130
131
+ ctx .ImportedLibraries .Add (finder .LibrariesFound ... )
130
132
ctx .IncludeFolders .AddAllMissing (finder .IncludeDirsFound )
131
133
if err := runCommand (ctx , & FailIfImportedLibraryIsWrong {}); err != nil {
132
134
return i18n .WrapError (err )
@@ -139,6 +141,7 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
139
141
// libraries used in a sketch and a way to cache this result for
140
142
// increasing detection speed on already processed sketches.
141
143
type CppIncludesFinder struct {
144
+ LibrariesFound libraries.List
142
145
IncludeDirsFound paths.PathList
143
146
ctx * types.Context
144
147
cache * includeCache
@@ -435,10 +438,9 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile *SourceFile) error
435
438
return i18n .WrapError (preprocErr )
436
439
}
437
440
438
- // Add this library to the list of libraries, the
439
- // include path and queue its source files for further
440
- // include scanning
441
- f .ctx .ImportedLibraries = append (f .ctx .ImportedLibraries , library )
441
+ // Add this library to the list of libraries found, add the include path
442
+ // and queue its source files for further include scanning
443
+ f .LibrariesFound .Add (library )
442
444
f .cache .AddAndCheckEntry (sourcePath , include , library .SourceDir )
443
445
444
446
sourceDirs := library .SourceDirs ()
0 commit comments