Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5a2cc3b

Browse files
committed
Moving ctx.ImportedLibraries usage out of CppIncludeFinder
1 parent f2503fe commit 5a2cc3b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎legacy/builder/container_find_includes.go‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ import (
9999
"os/exec"
100100
"time"
101101

102+
"github.com/arduino/arduino-cli/arduino/libraries"
102103
"github.com/arduino/arduino-cli/legacy/builder/builder_utils"
103104
"github.com/arduino/arduino-cli/legacy/builder/constants"
104105
"github.com/arduino/arduino-cli/legacy/builder/i18n"
@@ -127,6 +128,7 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
127128
return err
128129
}
129130

131+
ctx.ImportedLibraries.Add(finder.LibrariesFound...)
130132
ctx.IncludeFolders.AddAllMissing(finder.IncludeDirsFound)
131133
if err := runCommand(ctx, &FailIfImportedLibraryIsWrong{}); err != nil {
132134
return i18n.WrapError(err)
@@ -139,6 +141,7 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
139141
// libraries used in a sketch and a way to cache this result for
140142
// increasing detection speed on already processed sketches.
141143
type CppIncludesFinder struct {
144+
LibrariesFound libraries.List
142145
IncludeDirsFound paths.PathList
143146
ctx *types.Context
144147
cache *includeCache
@@ -435,10 +438,9 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile *SourceFile) error
435438
return i18n.WrapError(preprocErr)
436439
}
437440

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)
442444
f.cache.AddAndCheckEntry(sourcePath, include, library.SourceDir)
443445

444446
sourceDirs := library.SourceDirs()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /