@@ -132,10 +132,25 @@ func (l *SketchLibrariesDetector) ImportedLibraries() libraries.List {
132
132
return l .importedLibraries
133
133
}
134
134
135
- // AppendImportedLibraries todo should rename this, probably after refactoring the
136
- // container_find_includes command .
137
- func (l * SketchLibrariesDetector ) AppendImportedLibraries ( library * libraries.Library ) {
135
+ // addAndBuildLibrary adds the given library to the imported libraries list and queues its source files
136
+ // for further processing .
137
+ func (l * SketchLibrariesDetector ) addAndBuildLibrary ( sourceFileQueue * uniqueSourceFileQueue , librariesBuildPath * paths. Path , library * libraries.Library ) {
138
138
l .importedLibraries = append (l .importedLibraries , library )
139
+ if library .Precompiled && library .PrecompiledWithSources {
140
+ // Fully precompiled libraries should have no dependencies to avoid ABI breakage
141
+ if l .logger .VerbosityLevel () == logger .VerbosityVerbose {
142
+ l .logger .Info (i18n .Tr ("Skipping dependencies detection for precompiled library %[1]s" , library .Name ))
143
+ }
144
+ } else {
145
+ for _ , sourceDir := range library .SourceDirs () {
146
+ l .queueSourceFilesFromFolder (
147
+ sourceFileQueue ,
148
+ sourceDir .Dir , sourceDir .Recurse ,
149
+ library .SourceDir ,
150
+ librariesBuildPath .Join (library .DirName ),
151
+ library .UtilityDir )
152
+ }
153
+ }
139
154
}
140
155
141
156
// PrintUsedAndNotUsedLibraries todo
@@ -405,20 +420,9 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
405
420
// Add this library to the list of libraries, the
406
421
// include path and queue its source files for further
407
422
// include scanning
408
- l .AppendImportedLibraries ( library )
423
+ l .addAndBuildLibrary ( sourceFileQueue , librariesBuildPath , library )
409
424
l .appendIncludeFolder (cache , sourcePath , missingIncludeH , library .SourceDir )
410
425
411
- if library .Precompiled && library .PrecompiledWithSources {
412
- // Fully precompiled libraries should have no dependencies to avoid ABI breakage
413
- if l .logger .VerbosityLevel () == logger .VerbosityVerbose {
414
- l .logger .Info (i18n .Tr ("Skipping dependencies detection for precompiled library %[1]s" , library .Name ))
415
- }
416
- } else {
417
- for _ , sourceDir := range library .SourceDirs () {
418
- l .queueSourceFilesFromFolder (sourceFileQueue , sourceDir .Dir , sourceDir .Recurse ,
419
- library .SourceDir , librariesBuildPath .Join (library .DirName ), library .UtilityDir )
420
- }
421
- }
422
426
first = false
423
427
}
424
428
}
0 commit comments