@@ -41,14 +41,8 @@ import (
41
41
"github.com/arduino/go-properties-map"
42
42
)
43
43
44
- type GCCPreprocRunner struct {
45
- SourceFilePath string
46
- TargetFileName string
47
- Includes []string
48
- }
49
-
50
- func (s * GCCPreprocRunner ) Run (ctx * types.Context ) error {
51
- properties , targetFilePath , err := prepareGCCPreprocRecipeProperties (ctx , s .SourceFilePath , s .TargetFileName , s .Includes )
44
+ func GCCPreprocRunner (ctx * types.Context , sourceFilePath string , targetFilePath string , includes []string ) error {
45
+ properties , targetFilePath , err := prepareGCCPreprocRecipeProperties (ctx , sourceFilePath , targetFilePath , includes )
52
46
if err != nil {
53
47
return i18n .WrapError (err )
54
48
}
@@ -70,16 +64,10 @@ func (s *GCCPreprocRunner) Run(ctx *types.Context) error {
70
64
return nil
71
65
}
72
66
73
- type GCCPreprocRunnerForDiscoveringIncludes struct {
74
- SourceFilePath string
75
- TargetFilePath string
76
- Includes []string
77
- }
78
-
79
- func (s * GCCPreprocRunnerForDiscoveringIncludes ) Run (ctx * types.Context ) error {
80
- properties , _ , err := prepareGCCPreprocRecipeProperties (ctx , s .SourceFilePath , s .TargetFilePath , s .Includes )
67
+ func GCCPreprocRunnerForDiscoveringIncludes (ctx * types.Context , sourceFilePath string , targetFilePath string , includes []string ) (string , error ) {
68
+ properties , _ , err := prepareGCCPreprocRecipeProperties (ctx , sourceFilePath , targetFilePath , includes )
81
69
if err != nil {
82
- return i18n .WrapError (err )
70
+ return "" , i18n .WrapError (err )
83
71
}
84
72
85
73
verbose := ctx .Verbose
@@ -92,12 +80,10 @@ func (s *GCCPreprocRunnerForDiscoveringIncludes) Run(ctx *types.Context) error {
92
80
93
81
stderr , err := builder_utils .ExecRecipeCollectStdErr (properties , constants .RECIPE_PREPROC_MACROS , true , verbose , false , logger )
94
82
if err != nil {
95
- return i18n .WrapError (err )
83
+ return "" , i18n .WrapError (err )
96
84
}
97
85
98
- ctx .SourceGccMinusE = string (stderr )
99
-
100
- return nil
86
+ return string (stderr ), nil
101
87
}
102
88
103
89
func prepareGCCPreprocRecipeProperties (ctx * types.Context , sourceFilePath string , targetFilePath string , includes []string ) (properties.Map , string , error ) {
0 commit comments