Skip to content

Commit ab58758

Browse files
cmaglieOliver Schönrock
and
Oliver Schönrock
authored
Improved error messages for .cpp/.h file in the sketch (#1224)
Add #line tags to AdditionalFiles when copying to build directory Co-authored-by: Oliver Schönrock <[email protected]>
1 parent df03ad7 commit ab58758

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arduino/builder/sketch.go

+3
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ func SketchCopyAdditionalFiles(sketch *sketch.Sketch, destPath string, overrides
289289
sourceBytes = s
290290
}
291291

292+
// tag each addtional file with the filename of the source it was copied from
293+
sourceBytes = append([]byte("#line 1 "+QuoteCppString(item.Path)+"\n"), sourceBytes...)
294+
292295
err = writeIfDifferent(sourceBytes, targetPath)
293296
if err != nil {
294297
return errors.Wrap(err, "unable to write to destination file")

0 commit comments

Comments
 (0)