diff --git a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/defFileDependencies.kt b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/defFileDependencies.kt index 3badf996c6b..1b10a99565a 100644 --- a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/defFileDependencies.kt +++ b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/defFileDependencies.kt @@ -8,6 +8,8 @@ import org.jetbrains.kotlin.native.interop.indexer.NativeLibraryHeaders import org.jetbrains.kotlin.native.interop.indexer.getHeaderPaths import org.jetbrains.kotlin.native.interop.tool.CInteropArguments import java.io.File +import java.util.stream.Collectors +import kotlin.streams.toList fun defFileDependencies(args: Array) { val defFiles = mutableListOf() @@ -40,14 +42,14 @@ private fun makeDependencyAssignerForTarget(target: String, defFiles: List val tool = prepareTool(target, KotlinPlatform.NATIVE) val cinteropArguments = CInteropArguments() cinteropArguments.argParser.parse(arrayOf()) - val libraries = defFiles.associateWith { - buildNativeLibrary( + val libraries = defFiles.parallelStream().map { + it to buildNativeLibrary( tool, DefFile(it, tool.substitutions), cinteropArguments, ImportsImpl(emptyMap()) ).getHeaderPaths() - } + }.toList().toMap() return SingleTargetDependencyAssigner(libraries) }