@@ -96,10 +96,7 @@ func resolveLibraries(includes []string, headerToLibraries map[string][]*types.L
96
96
var library * types.Library
97
97
for _ , platform := range platforms {
98
98
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 )
103
100
library = findBestLibraryWithHeader (header , librariesWithinSpecifiedPlatform )
104
101
}
105
102
}
@@ -157,19 +154,17 @@ func librariesCompatibleWithPlatform(libraries []*types.Library, platform *types
157
154
return compatibleLibraries
158
155
}
159
156
160
- func librariesWithinPlatform (libraries []* types.Library , platform * types.Platform ) ( []* types.Library , error ) {
157
+ func librariesWithinPlatform (libraries []* types.Library , platform * types.Platform ) []* types.Library {
161
158
var librariesWithinSpecifiedPlatform []* types.Library
162
159
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 ) {
168
163
librariesWithinSpecifiedPlatform = append (librariesWithinSpecifiedPlatform , library )
169
164
}
170
165
}
171
166
172
- return librariesWithinSpecifiedPlatform , nil
167
+ return librariesWithinSpecifiedPlatform
173
168
174
169
}
175
170
0 commit comments