@@ -65,11 +65,11 @@ func (s *GCCPreprocRunner) Run(context map[string]interface{}) error {
65
65
66
66
type GCCPreprocRunnerForDiscoveringIncludes struct {
67
67
SourceFilePath string
68
- TargetFileName string
68
+ TargetFilePath string
69
69
}
70
70
71
71
func (s * GCCPreprocRunnerForDiscoveringIncludes ) Run (context map [string ]interface {}) error {
72
- properties , _ , err := prepareGCCPreprocRecipeProperties (context , s .SourceFilePath , s .TargetFileName )
72
+ properties , _ , err := prepareGCCPreprocRecipeProperties (context , s .SourceFilePath , s .TargetFilePath )
73
73
if err != nil {
74
74
return utils .WrapError (err )
75
75
}
@@ -86,13 +86,15 @@ func (s *GCCPreprocRunnerForDiscoveringIncludes) Run(context map[string]interfac
86
86
return nil
87
87
}
88
88
89
- func prepareGCCPreprocRecipeProperties (context map [string ]interface {}, sourceFilePath string , targetFileName string ) (map [string ]string , string , error ) {
90
- preprocPath := context [constants .CTX_PREPROC_PATH ].(string )
91
- err := utils .EnsureFolderExists (preprocPath )
92
- if err != nil {
93
- return nil , "" , utils .WrapError (err )
89
+ func prepareGCCPreprocRecipeProperties (context map [string ]interface {}, sourceFilePath string , targetFilePath string ) (map [string ]string , string , error ) {
90
+ if ! filepath .IsAbs (targetFilePath ) {
91
+ preprocPath := context [constants .CTX_PREPROC_PATH ].(string )
92
+ err := utils .EnsureFolderExists (preprocPath )
93
+ if err != nil {
94
+ return nil , "" , utils .WrapError (err )
95
+ }
96
+ targetFilePath = filepath .Join (preprocPath , targetFilePath )
94
97
}
95
- targetFilePath := filepath .Join (preprocPath , targetFileName )
96
98
97
99
buildProperties := utils .GetMapStringStringOrDefault (context , constants .CTX_BUILD_PROPERTIES )
98
100
properties := utils .MergeMapsOfStrings (make (map [string ]string ), buildProperties )
0 commit comments