@@ -65,11 +65,11 @@ func (s *GCCPreprocRunner) Run(context map[string]interface{}) error {
6565
6666type GCCPreprocRunnerForDiscoveringIncludes struct {
6767 SourceFilePath string
68- TargetFileName string
68+ TargetFilePath string
6969}
7070
7171func (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 )
7373 if err != nil {
7474 return utils .WrapError (err )
7575 }
@@ -86,13 +86,15 @@ func (s *GCCPreprocRunnerForDiscoveringIncludes) Run(context map[string]interfac
8686 return nil
8787}
8888
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 )
9497 }
95- targetFilePath := filepath .Join (preprocPath , targetFileName )
9698
9799 buildProperties := utils .GetMapStringStringOrDefault (context , constants .CTX_BUILD_PROPERTIES )
98100 properties := utils .MergeMapsOfStrings (make (map [string ]string ), buildProperties )
0 commit comments