Skip to content

Commit 571b922

Browse files
committed
Use absolute filepath for preprocessed cpp
Due to the changes in PR#236, paths must be absolute
1 parent 243b313 commit 571b922

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: preprocess_sketch.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,18 @@ func (s *PreprocessSketch) Run(ctx *types.Context) error {
5151
&ArduinoPreprocessorRunner{},
5252
}
5353

54+
err := utils.EnsureFolderExists(ctx.PreprocPath)
55+
if err != nil {
56+
return i18n.WrapError(err)
57+
}
58+
5459
if ctx.CodeCompleteAt != "" {
5560
commands = append(commands, &OutputCodeCompletions{})
5661
} else {
5762
commands = append(commands, &SketchSaver{})
5863
}
5964

60-
GCCPreprocRunner(ctx, sourceFile, constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E, ctx.IncludeFolders)
65+
GCCPreprocRunner(ctx, sourceFile, filepath.Join(ctx.PreprocPath, constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E), ctx.IncludeFolders)
6166

6267
for _, command := range commands {
6368
PrintRingNameIfDebug(ctx, command)
@@ -74,7 +79,7 @@ type ArduinoPreprocessorRunner struct{}
7479

7580
func (s *ArduinoPreprocessorRunner) Run(ctx *types.Context) error {
7681
buildProperties := ctx.BuildProperties
77-
targetFilePath := constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E
82+
targetFilePath := filepath.Join(ctx.PreprocPath, constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E)
7883
logger := ctx.GetLogger()
7984

8085
properties := buildProperties.Clone()

0 commit comments

Comments
 (0)