@@ -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/types"
@@ -126,6 +127,7 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
126
127
return err
127
128
}
128
129
130
+ ctx .ImportedLibraries .Add (finder .LibrariesFound ... )
129
131
ctx .IncludeFolders .AddAllMissing (finder .IncludeDirsFound )
130
132
if err := runCommand (ctx , & FailIfImportedLibraryIsWrong {}); err != nil {
131
133
return errors .WithStack (err )
@@ -138,6 +140,7 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
138
140
// libraries used in a sketch and a way to cache this result for
139
141
// increasing detection speed on already processed sketches.
140
142
type CppIncludesFinder struct {
143
+ LibrariesFound libraries.List
141
144
IncludeDirsFound paths.PathList
142
145
ctx * types.Context
143
146
cache * includeCache
@@ -434,10 +437,9 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile *SourceFile) error
434
437
return errors .WithStack (preprocErr )
435
438
}
436
439
437
- // Add this library to the list of libraries, the
438
- // include path and queue its source files for further
439
- // include scanning
440
- f .ctx .ImportedLibraries = append (f .ctx .ImportedLibraries , library )
440
+ // Add this library to the list of libraries found, add the include path
441
+ // and queue its source files for further include scanning
442
+ f .LibrariesFound .Add (library )
441
443
f .cache .AddAndCheckEntry (sourcePath , include , library .SourceDir )
442
444
443
445
sourceDirs := library .SourceDirs ()
0 commit comments