@@ -26,6 +26,7 @@ import (
26
26
"strings"
27
27
"time"
28
28
29
+ "github.com/arduino/arduino-cli/internal/arduino/builder/internal/diagnostics"
29
30
"github.com/arduino/arduino-cli/internal/arduino/builder/internal/logger"
30
31
"github.com/arduino/arduino-cli/internal/arduino/builder/internal/preprocessor"
31
32
"github.com/arduino/arduino-cli/internal/arduino/builder/internal/utils"
@@ -57,6 +58,7 @@ type SketchLibrariesDetector struct {
57
58
librariesResolutionResults map [string ]libraryResolutionResult
58
59
includeFolders paths.PathList
59
60
logger * logger.BuilderLogger
61
+ compilerOutputParser diagnostics.CompilerOutputParserCB
60
62
}
61
63
62
64
// NewSketchLibrariesDetector todo
@@ -66,6 +68,7 @@ func NewSketchLibrariesDetector(
66
68
useCachedLibrariesResolution bool ,
67
69
onlyUpdateCompilationDatabase bool ,
68
70
logger * logger.BuilderLogger ,
71
+ compilerOutputParser diagnostics.CompilerOutputParserCB ,
69
72
) * SketchLibrariesDetector {
70
73
return & SketchLibrariesDetector {
71
74
librariesManager : lm ,
@@ -76,6 +79,7 @@ func NewSketchLibrariesDetector(
76
79
includeFolders : paths.PathList {},
77
80
onlyUpdateCompilationDatabase : onlyUpdateCompilationDatabase ,
78
81
logger : logger ,
82
+ compilerOutputParser : compilerOutputParser ,
79
83
}
80
84
}
81
85
@@ -347,7 +351,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
347
351
}
348
352
} else {
349
353
var preprocStdout []byte
350
- preprocStdout , preprocStderr , preprocErr = preprocessor .GCC (sourcePath , targetFilePath , includeFolders , buildProperties )
354
+ preprocStdout , preprocStderr , preprocErr = preprocessor .GCC (sourcePath , targetFilePath , includeFolders , buildProperties , nil )
351
355
if l .logger .Verbose () {
352
356
l .logger .WriteStdout (preprocStdout )
353
357
}
@@ -379,7 +383,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
379
383
if preprocErr == nil || preprocStderr == nil {
380
384
// Filename came from cache, so run preprocessor to obtain error to show
381
385
var preprocStdout []byte
382
- preprocStdout , preprocStderr , preprocErr = preprocessor .GCC (sourcePath , targetFilePath , includeFolders , buildProperties )
386
+ preprocStdout , preprocStderr , preprocErr = preprocessor .GCC (sourcePath , targetFilePath , includeFolders , buildProperties , l . compilerOutputParser )
383
387
if l .logger .Verbose () {
384
388
l .logger .WriteStdout (preprocStdout )
385
389
}
0 commit comments