Add filtering for standard KLIBs

This commit is contained in:
Dmitriy Dolovov
2019-04-26 14:16:48 +07:00
committed by Ilya Matveev
parent c3638e48dc
commit 5503b12a17
2 changed files with 6 additions and 2 deletions
@@ -159,9 +159,11 @@ internal open class KonanLibrarySearchPathResolver(
if (!noDefaultLibs) {
val defaultLibs = defaultRoots.flatMap { it.listFiles }
.asSequence()
.filterNot { it.name.startsWith('.') }
.filterNot { it.name.removeSuffixIfPresent(KLIB_FILE_EXTENSION_WITH_DOT) == KONAN_STDLIB_NAME }
.map { UnresolvedLibrary(it.absolutePath, null) }
.map {resolve(it, isDefaultLink = true) }
.map { resolve(it, isDefaultLink = true) }
result.addAll(defaultLibs)
}
@@ -37,7 +37,9 @@ internal fun zippedKonanLibraryChecks(klibFile: File) {
check(klibFile.isFile) { "Expected $klibFile to be a regular file." }
val extension = klibFile.extension
check(extension.isEmpty() || extension == KLIB_FILE_EXTENSION) { "Unexpected file extension: $extension" }
check(extension.isEmpty() || extension == KLIB_FILE_EXTENSION) {
"KLIB path has unexpected extension: $klibFile"
}
}
private class UnzippedKonanLibraryLayout(override val libDir: File, override val target: KonanTarget?): KonanLibraryLayoutImpl {