@@ -42,9 +42,9 @@ import (
42
42
type ContainerFindIncludes struct {}
43
43
44
44
func (s * ContainerFindIncludes ) Run (ctx * types.Context ) error {
45
- ctx . IncludeFolders = append (ctx . IncludeFolders , ctx .BuildProperties [constants .BUILD_PROPERTIES_BUILD_CORE_PATH ])
45
+ appendIncludeFolder (ctx , ctx .BuildProperties [constants .BUILD_PROPERTIES_BUILD_CORE_PATH ])
46
46
if ctx .BuildProperties [constants .BUILD_PROPERTIES_BUILD_VARIANT_PATH ] != constants .EMPTY_STRING {
47
- ctx . IncludeFolders = append (ctx . IncludeFolders , ctx .BuildProperties [constants .BUILD_PROPERTIES_BUILD_VARIANT_PATH ])
47
+ appendIncludeFolder (ctx , ctx .BuildProperties [constants .BUILD_PROPERTIES_BUILD_VARIANT_PATH ])
48
48
}
49
49
50
50
sketchBuildPath := ctx .SketchBuildPath
@@ -73,6 +73,11 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
73
73
return nil
74
74
}
75
75
76
+ // Append the given folder to the include path.
77
+ func appendIncludeFolder (ctx * types.Context , folder string ) {
78
+ ctx .IncludeFolders = append (ctx .IncludeFolders , folder )
79
+ }
80
+
76
81
func runCommand (ctx * types.Context , command types.Command ) error {
77
82
PrintRingNameIfDebug (ctx , command )
78
83
err := command .Run (ctx )
@@ -111,7 +116,7 @@ func findIncludesUntilDone(ctx *types.Context, sourceFilePath string) error {
111
116
// include path and queue its source files for further
112
117
// include scanning
113
118
ctx .ImportedLibraries = append (ctx .ImportedLibraries , library )
114
- ctx . IncludeFolders = append (ctx . IncludeFolders , library .SrcFolder )
119
+ appendIncludeFolder (ctx , library .SrcFolder )
115
120
sourceFolders := types .LibraryToSourceFolder (library )
116
121
for _ , sourceFolder := range sourceFolders {
117
122
queueSourceFilesFromFolder (ctx .CollectedSourceFiles , sourceFolder .Folder , sourceFolder .Recurse )
0 commit comments