@@ -31,14 +31,14 @@ import (
31
31
"github.com/pkg/errors"
32
32
)
33
33
34
- func PreprocessSketchWithArduinoPreprocessor (sk * sketch.Sketch , buildPath * paths.Path , includeFolders paths.PathList , sketchBuildPath * paths. Path , buildProperties * properties.Map ) ([]byte , []byte , error ) {
34
+ func PreprocessSketchWithArduinoPreprocessor (sk * sketch.Sketch , buildPath * paths.Path , includeFolders paths.PathList , lineOffset int , buildProperties * properties.Map , onlyUpdateCompilationDatabase bool ) ([]byte , []byte , error ) {
35
35
verboseOut := & bytes.Buffer {}
36
36
normalOut := & bytes.Buffer {}
37
37
if err := buildPath .Join ("preproc" ).MkdirAll (); err != nil {
38
38
return nil , nil , err
39
39
}
40
40
41
- sourceFile := sketchBuildPath .Join (sk .MainFile .Base () + ".cpp" )
41
+ sourceFile := buildPath .Join ("sketch" , sk .MainFile .Base ()+ ".cpp" )
42
42
targetFile := buildPath .Join ("preproc" , "sketch_merged.cpp" )
43
43
gccStdout , gccStderr , err := preprocessor .GCC (sourceFile , targetFile , includeFolders , buildProperties )
44
44
verboseOut .Write (gccStdout )
@@ -83,5 +83,6 @@ func PreprocessSketchWithArduinoPreprocessor(sk *sketch.Sketch, buildPath *paths
83
83
}
84
84
result := utils .NormalizeUTF8 (commandStdOut )
85
85
86
- return normalOut .Bytes (), verboseOut .Bytes (), bldr .SketchSaveItemCpp (sk .MainFile , result , sketchBuildPath )
86
+ err = bldr .SketchSaveItemCpp (sk .MainFile , result , buildPath .Join ("sketch" ))
87
+ return normalOut .Bytes (), verboseOut .Bytes (), err
87
88
}
0 commit comments