@@ -489,8 +489,11 @@ func findIncludeForOldCompilers(source string) string {
489489func LibrariesLoader (
490490 useCachedLibrariesResolution bool ,
491491 librariesManager * librariesmanager.LibrariesManager ,
492- builtInLibrariesDirs * paths.Path , libraryDirs , otherLibrariesDirs paths.PathList ,
493- actualPlatform , targetPlatform * cores.PlatformRelease ,
492+ builtInLibrariesDir * paths.Path ,
493+ customLibraryDirs paths.PathList ,
494+ librariesDirs paths.PathList ,
495+ buildPlatform * cores.PlatformRelease ,
496+ targetPlatform * cores.PlatformRelease ,
494497) (* librariesresolver.Cpp , []byte , error ) {
495498 verboseOut := & bytes.Buffer {}
496499 lm := librariesManager
@@ -502,21 +505,20 @@ func LibrariesLoader(
502505 if librariesManager == nil {
503506 lmb := librariesmanager .NewBuilder ()
504507
505- builtInLibrariesFolders := builtInLibrariesDirs
506- if builtInLibrariesFolders != nil {
507- if err := builtInLibrariesFolders .ToAbs (); err != nil {
508+ if builtInLibrariesDir != nil {
509+ if err := builtInLibrariesDir .ToAbs (); err != nil {
508510 return nil , nil , err
509511 }
510512 lmb .AddLibrariesDir (librariesmanager.LibrariesDir {
511- Path : builtInLibrariesFolders ,
513+ Path : builtInLibrariesDir ,
512514 Location : libraries .IDEBuiltIn ,
513515 })
514516 }
515517
516- if actualPlatform != targetPlatform {
518+ if buildPlatform != targetPlatform {
517519 lmb .AddLibrariesDir (librariesmanager.LibrariesDir {
518- PlatformRelease : actualPlatform ,
519- Path : actualPlatform .GetLibrariesDir (),
520+ PlatformRelease : buildPlatform ,
521+ Path : buildPlatform .GetLibrariesDir (),
520522 Location : libraries .ReferencedPlatformBuiltIn ,
521523 })
522524 }
@@ -526,7 +528,7 @@ func LibrariesLoader(
526528 Location : libraries .PlatformBuiltIn ,
527529 })
528530
529- librariesFolders := otherLibrariesDirs
531+ librariesFolders := librariesDirs
530532 if err := librariesFolders .ToAbs (); err != nil {
531533 return nil , nil , err
532534 }
@@ -537,7 +539,7 @@ func LibrariesLoader(
537539 })
538540 }
539541
540- for _ , dir := range libraryDirs {
542+ for _ , dir := range customLibraryDirs {
541543 lmb .AddLibrariesDir (librariesmanager.LibrariesDir {
542544 Path : dir ,
543545 Location : libraries .Unmanaged ,
@@ -547,18 +549,12 @@ func LibrariesLoader(
547549
548550 newLm , libsLoadingWarnings := lmb .Build ()
549551 for _ , status := range libsLoadingWarnings {
550- // With the refactoring of the initialization step of the CLI we changed how
551- // errors are returned when loading platforms and libraries, that meant returning a list of
552- // errors instead of a single one to enhance the experience for the user.
553- // I have no intention right now to start a refactoring of the legacy package too, so
554- // here's this shitty solution for now.
555- // When we're gonna refactor the legacy package this will be gone.
556552 verboseOut .Write ([]byte (status .Message ()))
557553 }
558554 lm = newLm
559555 }
560556
561557 allLibs := lm .FindAllInstalled ()
562- resolver := librariesresolver .NewCppResolver (allLibs , targetPlatform , actualPlatform )
558+ resolver := librariesresolver .NewCppResolver (allLibs , targetPlatform , buildPlatform )
563559 return resolver , verboseOut .Bytes (), nil
564560}
0 commit comments