@@ -29,9 +29,9 @@ import (
29
29
"github.com/arduino/arduino-cli/legacy/builder/utils"
30
30
)
31
31
32
- var ValidExportExtensions = []string {".h" , ".c" , ".hpp" , ".hh" , ".cpp" , ".S" , ".a" , ".properties" }
33
- var DotHExtension = []string {".h" , ".hh" , ".hpp" }
34
- var DotAExtension = []string {".a" }
32
+ var validExportExtensions = []string {".h" , ".c" , ".hpp" , ".hh" , ".cpp" , ".S" , ".a" , ".properties" }
33
+ var dotHExtension = []string {".h" , ".hh" , ".hpp" }
34
+ var dotAExtension = []string {".a" }
35
35
36
36
func stringArrayToLookupFunction (in []string ) func (string ) bool {
37
37
out := map [string ]bool {}
@@ -73,7 +73,7 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
73
73
cmakeFile := cmakeFolder .Join ("CMakeLists.txt" )
74
74
75
75
dynamicLibsFromPkgConfig := map [string ]bool {}
76
- extensions := stringArrayToLookupFunction (ValidExportExtensions )
76
+ extensions := stringArrayToLookupFunction (validExportExtensions )
77
77
for _ , library := range ctx .ImportedLibraries {
78
78
// Copy used libraries in the correct folder
79
79
libDir := libBaseFolder .Join (library .Name )
@@ -98,7 +98,7 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
98
98
}
99
99
100
100
// Remove stray folders contining incompatible or not needed libraries archives
101
- files , _ := utils .FindFilesInFolder (libDir .Join ("src" ), true , DotAExtension )
101
+ files , _ := utils .FindFilesInFolder (libDir .Join ("src" ), true , dotAExtension )
102
102
for _ , file := range files {
103
103
staticLibDir := file .Parent ()
104
104
if ! isStaticLib || ! strings .Contains (staticLibDir .String (), mcu ) {
@@ -134,7 +134,7 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
134
134
}
135
135
136
136
// remove "#line 1 ..." from exported c_make folder sketch
137
- sketchFiles , _ := utils .FindFilesInFolder (cmakeFolder .Join ("sketch" ), false , ValidExportExtensions )
137
+ sketchFiles , _ := utils .FindFilesInFolder (cmakeFolder .Join ("sketch" ), false , validExportExtensions )
138
138
139
139
for _ , file := range sketchFiles {
140
140
input , err := file .ReadFile ()
@@ -168,11 +168,11 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
168
168
extractCompileFlags (ctx , "recipe.cpp.o.pattern" , & defines , & dynamicLibsFromGccMinusL , & linkerflags , & linkDirectories )
169
169
170
170
// Extract folders with .h in them for adding in include list
171
- headerFiles , _ := utils .FindFilesInFolder (cmakeFolder , true , DotHExtension )
171
+ headerFiles , _ := utils .FindFilesInFolder (cmakeFolder , true , dotHExtension )
172
172
foldersContainingDotH := findUniqueFoldersRelative (headerFiles .AsStrings (), cmakeFolder .String ())
173
173
174
174
// Extract folders with .a in them for adding in static libs paths list
175
- staticLibs , _ := utils .FindFilesInFolder (cmakeFolder , true , DotAExtension )
175
+ staticLibs , _ := utils .FindFilesInFolder (cmakeFolder , true , dotAExtension )
176
176
177
177
// Generate the CMakeLists global file
178
178
0 commit comments