@@ -36,27 +36,6 @@ import (
36
36
37
37
var tr = i18n .Tr
38
38
39
- func CompileFiles (ctx * types.Context , sourcePath * paths.Path , recurse bool , buildPath * paths.Path , buildProperties * properties.Map , includes []string ) (paths.PathList , error ) {
40
- var sources paths.PathList
41
- var err error
42
- if recurse {
43
- sources , err = sourcePath .ReadDirRecursive ()
44
- } else {
45
- sources , err = sourcePath .ReadDir ()
46
- }
47
- if err != nil {
48
- return nil , err
49
- }
50
-
51
- validExtensions := []string {".S" , ".c" , ".cpp" }
52
-
53
- sources .FilterSuffix (validExtensions ... )
54
- ctx .Progress .AddSubSteps (len (sources ))
55
- defer ctx .Progress .RemoveSubSteps ()
56
-
57
- return compileFilesWithRecipe (ctx , sourcePath , sources , buildPath , buildProperties , includes , validExtensions )
58
- }
59
-
60
39
func findAllFilesInFolder (sourcePath string , recurse bool ) ([]string , error ) {
61
40
files , err := utils .ReadDirFiltered (sourcePath , utils .FilterFiles ())
62
41
if err != nil {
@@ -88,12 +67,29 @@ func findAllFilesInFolder(sourcePath string, recurse bool) ([]string, error) {
88
67
return sources , nil
89
68
}
90
69
91
- func compileFilesWithRecipe (ctx * types.Context , sourcePath * paths.Path , sources paths.PathList , buildPath * paths.Path , buildProperties * properties.Map , includes []string , validExtensions []string ) (paths.PathList , error ) {
70
+ func CompileFiles (ctx * types.Context , sourcePath * paths.Path , recurse bool , buildPath * paths.Path , buildProperties * properties.Map , includes []string ) (paths.PathList , error ) {
71
+ var sources paths.PathList
72
+ var err error
73
+ if recurse {
74
+ sources , err = sourcePath .ReadDirRecursive ()
75
+ } else {
76
+ sources , err = sourcePath .ReadDir ()
77
+ }
78
+ if err != nil {
79
+ return nil , err
80
+ }
81
+
82
+ validExtensions := []string {".S" , ".c" , ".cpp" }
83
+
84
+ sources .FilterSuffix (validExtensions ... )
85
+ ctx .Progress .AddSubSteps (len (sources ))
86
+ defer ctx .Progress .RemoveSubSteps ()
87
+
92
88
objectFiles := paths .NewPathList ()
89
+ var objectFilesMux sync.Mutex
93
90
if len (sources ) == 0 {
94
91
return objectFiles , nil
95
92
}
96
- var objectFilesMux sync.Mutex
97
93
var errorsList []error
98
94
var errorsMux sync.Mutex
99
95
0 commit comments