@@ -490,8 +490,11 @@ func findIncludeForOldCompilers(source string) string {
490490func LibrariesLoader (
491491 useCachedLibrariesResolution bool ,
492492 librariesManager * librariesmanager.LibrariesManager ,
493- builtInLibrariesDirs * paths.Path , libraryDirs , otherLibrariesDirs paths.PathList ,
494- actualPlatform , targetPlatform * cores.PlatformRelease ,
493+ builtInLibrariesDir * paths.Path ,
494+ customLibraryDirs paths.PathList ,
495+ librariesDirs paths.PathList ,
496+ buildPlatform * cores.PlatformRelease ,
497+ targetPlatform * cores.PlatformRelease ,
495498) (* librariesresolver.Cpp , []byte , error ) {
496499 verboseOut := & bytes.Buffer {}
497500 lm := librariesManager
@@ -503,21 +506,20 @@ func LibrariesLoader(
503506 if librariesManager == nil {
504507 lmb := librariesmanager .NewBuilder ()
505508
506- builtInLibrariesFolders := builtInLibrariesDirs
507- if builtInLibrariesFolders != nil {
508- if err := builtInLibrariesFolders .ToAbs (); err != nil {
509+ if builtInLibrariesDir != nil {
510+ if err := builtInLibrariesDir .ToAbs (); err != nil {
509511 return nil , nil , err
510512 }
511513 lmb .AddLibrariesDir (librariesmanager.LibrariesDir {
512- Path : builtInLibrariesFolders ,
514+ Path : builtInLibrariesDir ,
513515 Location : libraries .IDEBuiltIn ,
514516 })
515517 }
516518
517- if actualPlatform != targetPlatform {
519+ if buildPlatform != targetPlatform {
518520 lmb .AddLibrariesDir (librariesmanager.LibrariesDir {
519- PlatformRelease : actualPlatform ,
520- Path : actualPlatform .GetLibrariesDir (),
521+ PlatformRelease : buildPlatform ,
522+ Path : buildPlatform .GetLibrariesDir (),
521523 Location : libraries .ReferencedPlatformBuiltIn ,
522524 })
523525 }
@@ -527,7 +529,7 @@ func LibrariesLoader(
527529 Location : libraries .PlatformBuiltIn ,
528530 })
529531
530- librariesFolders := otherLibrariesDirs
532+ librariesFolders := librariesDirs
531533 if err := librariesFolders .ToAbs (); err != nil {
532534 return nil , nil , err
533535 }
@@ -538,7 +540,7 @@ func LibrariesLoader(
538540 })
539541 }
540542
541- for _ , dir := range libraryDirs {
543+ for _ , dir := range customLibraryDirs {
542544 lmb .AddLibrariesDir (librariesmanager.LibrariesDir {
543545 Path : dir ,
544546 Location : libraries .Unmanaged ,
@@ -548,18 +550,12 @@ func LibrariesLoader(
548550
549551 newLm , libsLoadingWarnings := lmb .Build ()
550552 for _ , status := range libsLoadingWarnings {
551- // With the refactoring of the initialization step of the CLI we changed how
552- // errors are returned when loading platforms and libraries, that meant returning a list of
553- // errors instead of a single one to enhance the experience for the user.
554- // I have no intention right now to start a refactoring of the legacy package too, so
555- // here's this shitty solution for now.
556- // When we're gonna refactor the legacy package this will be gone.
557553 verboseOut .Write ([]byte (status .Message ()))
558554 }
559555 lm = newLm
560556 }
561557
562558 allLibs := lm .FindAllInstalled ()
563- resolver := librariesresolver .NewCppResolver (allLibs , targetPlatform , actualPlatform )
559+ resolver := librariesresolver .NewCppResolver (allLibs , targetPlatform , buildPlatform )
564560 return resolver , verboseOut .Bytes (), nil
565561}
0 commit comments