[gradle-plugin] Pass only klib dependencies to the compiler
Fix for KT-28205.
This commit is contained in:
committed by
Ilya Matveev
parent
1ec506d0b1
commit
e5ab2c71fb
+3
-1
@@ -108,7 +108,9 @@ open class CInteropTask @Inject constructor(val settings: CInteropSettingsImpl):
|
|||||||
addArgs("-copt", allHeadersDirs.map { "-I${it.absolutePath}" })
|
addArgs("-copt", allHeadersDirs.map { "-I${it.absolutePath}" })
|
||||||
addArgs("-headerFilterAdditionalSearchPrefix", headerFilterDirs.map { it.absolutePath })
|
addArgs("-headerFilterAdditionalSearchPrefix", headerFilterDirs.map { it.absolutePath })
|
||||||
|
|
||||||
libraries.files.forEach {
|
libraries.files.filter {
|
||||||
|
it.extension == "klib"
|
||||||
|
}.forEach {
|
||||||
addArg("-l", it.absolutePath)
|
addArg("-l", it.absolutePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -158,7 +158,9 @@ open class KotlinNativeCompile @Inject constructor(internal val binary: Abstract
|
|||||||
|
|
||||||
addAll(additionalCompilerOptions)
|
addAll(additionalCompilerOptions)
|
||||||
|
|
||||||
libraries.files.forEach {
|
libraries.files.filter {
|
||||||
|
it.extension == "klib"
|
||||||
|
}.forEach {
|
||||||
addArg("-l", it.absolutePath)
|
addArg("-l", it.absolutePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -932,6 +932,11 @@ class ExperimentalPluginTests {
|
|||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
implementation 'org.jetbrains.kotlin:kotlin-stdlib-common'
|
||||||
|
}
|
||||||
|
}
|
||||||
wasmMain {
|
wasmMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'test:native-producer:1.0'
|
implementation 'test:native-producer:1.0'
|
||||||
@@ -973,6 +978,8 @@ class ExperimentalPluginTests {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url '$repoPath' }
|
maven { url '$repoPath' }
|
||||||
|
maven { url "${MultiplatformSpecification.KOTLIN_REPO}" }
|
||||||
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.main.component {
|
sourceSets.main.component {
|
||||||
|
|||||||
Reference in New Issue
Block a user