Skip to content

Commit edaa626

Browse files
cmagliefacchinm
authored andcommitted
cmake: moved some lines for better readability
1 parent 8f2d773 commit edaa626

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

create_cmake_rule.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,19 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
7676
coreFolder := filepath.Join(cmakeFolder, "core")
7777
cmakeFile := filepath.Join(cmakeFolder, "CMakeLists.txt")
7878

79-
// Copy used libraries in the correct folder
8079
extensions := func(ext string) bool { return VALID_EXPORT_EXTENSIONS[ext] }
80+
staticLibsExtensions := func(ext string) bool { return DOTAEXTENSION[ext] }
8181
for _, library := range ctx.ImportedLibraries {
82+
// Copy used libraries in the correct folder
8283
libFolder := filepath.Join(libBaseFolder, library.Name)
84+
mcu := ctx.BuildProperties[constants.BUILD_PROPERTIES_BUILD_MCU]
8385
utils.CopyDir(library.Folder, libFolder, extensions)
8486
// Remove examples folder
8587
if _, err := os.Stat(filepath.Join(libFolder, "examples")); err == nil {
8688
os.RemoveAll(filepath.Join(libFolder, "examples"))
8789
}
88-
// Remove stray folders contining incompatible libraries
89-
staticLibsExtensions := func(ext string) bool { return DOTAEXTENSION[ext] }
90-
mcu := ctx.BuildProperties[constants.BUILD_PROPERTIES_BUILD_MCU]
90+
91+
// Remove stray folders contining incompatible or not needed libraries archives
9192
var files []string
9293
utils.FindFilesInFolder(&files, filepath.Join(libFolder, "src"), staticLibsExtensions, true)
9394
for _, file := range files {

0 commit comments

Comments
 (0)