@@ -96,10 +96,7 @@ func resolveLibraries(includes []string, headerToLibraries map[string][]*types.L
9696 var library * types.Library
9797 for _ , platform := range platforms {
9898 if platform != nil && library == nil {
99- librariesWithinSpecifiedPlatform , err := librariesWithinPlatform (libraries , platform )
100- if err != nil {
101- return nil , utils .WrapError (err )
102- }
99+ librariesWithinSpecifiedPlatform := librariesWithinPlatform (libraries , platform )
103100 library = findBestLibraryWithHeader (header , librariesWithinSpecifiedPlatform )
104101 }
105102 }
@@ -157,19 +154,17 @@ func librariesCompatibleWithPlatform(libraries []*types.Library, platform *types
157154 return compatibleLibraries
158155}
159156
160- func librariesWithinPlatform (libraries []* types.Library , platform * types.Platform ) ( []* types.Library , error ) {
157+ func librariesWithinPlatform (libraries []* types.Library , platform * types.Platform ) []* types.Library {
161158 var librariesWithinSpecifiedPlatform []* types.Library
162159 for _ , library := range libraries {
163- rel , err := filepath .Rel (platform .Folder , library .SrcFolder )
164- if err != nil {
165- return nil , utils .WrapError (err )
166- }
167- if ! strings .Contains (rel , ".." ) {
160+ cleanPlatformFolder := filepath .Clean (platform .Folder )
161+ cleanLibraryFolder := filepath .Clean (library .SrcFolder )
162+ if strings .Contains (cleanLibraryFolder , cleanPlatformFolder ) {
168163 librariesWithinSpecifiedPlatform = append (librariesWithinSpecifiedPlatform , library )
169164 }
170165 }
171166
172- return librariesWithinSpecifiedPlatform , nil
167+ return librariesWithinSpecifiedPlatform
173168
174169}
175170
0 commit comments