Skip to content

Commit 48bc522

Browse files
committed
Skip includes detection of precompiled libraries early
Instead of skipping include detection later, avoid to add the sources in the queue right from the beginning.
1 parent feae077 commit 48bc522

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

Diff for: legacy/builder/container_find_includes.go

+10-13
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,6 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
343343
if library := sourceFile.Library; library != nil && library.UtilityDir != nil {
344344
includeFolders = append(includeFolders, library.UtilityDir)
345345
}
346-
347-
if library := sourceFile.Library; library != nil {
348-
if library.Precompiled && library.PrecompiledWithSources {
349-
// Fully precompiled libraries should have no dependencies
350-
// to avoid ABI breakage
351-
if ctx.Verbose {
352-
ctx.Info(tr("Skipping dependencies detection for precompiled library %[1]s", library.Name))
353-
}
354-
return nil
355-
}
356346
}
357347

358348
var preprocErr error
@@ -419,9 +409,16 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
419409
// include scanning
420410
ctx.ImportedLibraries = append(ctx.ImportedLibraries, library)
421411
appendIncludeFolder(ctx, cache, sourcePath, missingIncludeH, library.SourceDir)
422-
sourceDirs := library.SourceDirs()
423-
for _, sourceDir := range sourceDirs {
424-
queueSourceFilesFromFolder(ctx, sourceFileQueue, library, sourceDir.Dir, sourceDir.Recurse)
412+
413+
if library.Precompiled && library.PrecompiledWithSources {
414+
// Fully precompiled libraries should have no dependencies to avoid ABI breakage
415+
if ctx.Verbose {
416+
ctx.Info(tr("Skipping dependencies detection for precompiled library %[1]s", library.Name))
417+
}
418+
} else {
419+
for _, sourceDir := range library.SourceDirs() {
420+
queueSourceFilesFromFolder(ctx, sourceFileQueue, library, sourceDir.Dir, sourceDir.Recurse)
421+
}
425422
}
426423
first = false
427424
}

0 commit comments

Comments
 (0)