Skip to content

Commit 748c70d

Browse files
committed
Revert "[CMAKE] include Arduino.h in main sketch file"
This reverts commit e7600b5.
1 parent 9b7af5e commit 748c70d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: sketch_source_merger.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131
package builder
3232

3333
import (
34-
"regexp"
35-
3634
"github.com/arduino/arduino-builder/types"
3735
"github.com/arduino/arduino-builder/utils"
36+
"regexp"
3837
)
3938

4039
type SketchSourceMerger struct{}
@@ -44,12 +43,12 @@ func (s *SketchSourceMerger) Run(ctx *types.Context) error {
4443

4544
lineOffset := 0
4645
includeSection := ""
47-
includeSection += "#line 1 " + utils.QuoteCppString(sketch.MainFile.Name) + "\n"
48-
lineOffset++
4946
if !sketchIncludesArduinoH(&sketch.MainFile) {
5047
includeSection += "#include <Arduino.h>\n"
5148
lineOffset++
5249
}
50+
includeSection += "#line 1 " + utils.QuoteCppString(sketch.MainFile.Name) + "\n"
51+
lineOffset++
5352
ctx.IncludeSection = includeSection
5453

5554
source := includeSection

0 commit comments

Comments
 (0)