@@ -98,6 +98,7 @@ import (
98
98
"os/exec"
99
99
"time"
100
100
101
+ "github.com/arduino/arduino-cli/arduino/libraries"
101
102
"github.com/arduino/arduino-cli/legacy/builder/builder_utils"
102
103
"github.com/arduino/arduino-cli/legacy/builder/types"
103
104
"github.com/arduino/arduino-cli/legacy/builder/utils"
@@ -136,6 +137,7 @@ func (s *ContainerFindIncludes) findIncludes(ctx *types.Context) error {
136
137
return err
137
138
}
138
139
140
+ ctx .ImportedLibraries .Add (finder .LibrariesFound ... )
139
141
ctx .IncludeFolders .AddAllMissing (finder .IncludeDirsFound )
140
142
if err := runCommand (ctx , & FailIfImportedLibraryIsWrong {}); err != nil {
141
143
return errors .WithStack (err )
@@ -148,6 +150,7 @@ func (s *ContainerFindIncludes) findIncludes(ctx *types.Context) error {
148
150
// libraries used in a sketch and a way to cache this result for
149
151
// increasing detection speed on already processed sketches.
150
152
type CppIncludesFinder struct {
153
+ LibrariesFound libraries.List
151
154
IncludeDirsFound paths.PathList
152
155
ctx * types.Context
153
156
cache * includeCache
@@ -444,10 +447,9 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile *SourceFile) error
444
447
return errors .WithStack (preprocErr )
445
448
}
446
449
447
- // Add this library to the list of libraries, the
448
- // include path and queue its source files for further
449
- // include scanning
450
- f .ctx .ImportedLibraries = append (f .ctx .ImportedLibraries , library )
450
+ // Add this library to the list of libraries found, add the include path
451
+ // and queue its source files for further include scanning
452
+ f .LibrariesFound .Add (library )
451
453
f .cache .AddAndCheckEntry (sourcePath , include , library .SourceDir )
452
454
453
455
sourceDirs := library .SourceDirs ()
0 commit comments