@@ -42,9 +42,9 @@ import (
4242type ContainerFindIncludes struct {}
4343
4444func (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 ])
4646 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 ])
4848 }
4949
5050 sketchBuildPath := ctx .SketchBuildPath
@@ -73,6 +73,11 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
7373 return nil
7474}
7575
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+
7681func runCommand (ctx * types.Context , command types.Command ) error {
7782 PrintRingNameIfDebug (ctx , command )
7883 err := command .Run (ctx )
@@ -111,7 +116,7 @@ func findIncludesUntilDone(ctx *types.Context, sourceFilePath string) error {
111116 // include path and queue its source files for further
112117 // include scanning
113118 ctx .ImportedLibraries = append (ctx .ImportedLibraries , library )
114- ctx . IncludeFolders = append (ctx . IncludeFolders , library .SrcFolder )
119+ appendIncludeFolder (ctx , library .SrcFolder )
115120 sourceFolders := types .LibraryToSourceFolder (library )
116121 for _ , sourceFolder := range sourceFolders {
117122 queueSourceFilesFromFolder (ctx .CollectedSourceFiles , sourceFolder .Folder , sourceFolder .Recurse )
0 commit comments