KLIB: Avoid check for KLIBs w/o components for other platforms than Native

This commit is contained in:
Dmitriy Dolovov
2020-03-23 20:17:48 +07:00
parent ad1a1ac49a
commit e81479e30b
@@ -40,9 +40,13 @@ fun VirtualFile.isKlibLibraryRootForPlatform(targetPlatform: TargetPlatform): Bo
// run check for library root too
// this is necessary to recognize old style KLIBs that do not have components, and report tem to user appropriately
// (relevant only for Kotlin/Native KLIBs)
val requestedBuiltInsPlatform = targetPlatform.toBuiltInsPlatform()
return checkKlibComponent(this, requestedBuiltInsPlatform) ||
children?.any { checkKlibComponent(it, requestedBuiltInsPlatform) } == true
if (requestedBuiltInsPlatform == BuiltInsPlatform.NATIVE && checkKlibComponent(this, requestedBuiltInsPlatform)) {
return true
}
return children?.any { checkKlibComponent(it, requestedBuiltInsPlatform) } == true
}
private fun checkKlibComponent(componentFile: VirtualFile, requestedBuiltInsPlatform: BuiltInsPlatform): Boolean {