[Gradle] KotlinNativeLink: Use singleLinkerArguments instead of linkerArguments

KTIJ-24976
This commit is contained in:
Sebastian Sellmair
2023-03-29 10:38:53 +02:00
committed by Space Team
parent 9f2ee09ddb
commit a681f6a1ce
2 changed files with 7 additions and 2 deletions
@@ -8,6 +8,8 @@ import org.gradle.api.logging.LogLevel
import org.jetbrains.kotlin.gradle.native.GeneralNativeIT.Companion.withNativeCommandLineArguments
import org.jetbrains.kotlin.gradle.native.GeneralNativeIT.Companion.containsSequentially
import org.gradle.util.GradleVersion
import org.jetbrains.kotlin.cli.common.arguments.K2NativeCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.parseCommandLineArguments
import org.jetbrains.kotlin.gradle.native.*
import org.jetbrains.kotlin.gradle.native.MPPNativeTargets
import org.jetbrains.kotlin.gradle.native.transformNativeTestProject
@@ -201,6 +203,8 @@ open class NewMultiplatformIT : BaseGradleIT() {
// Check that linker options were correctly passed to the K/N compiler.
withNativeCommandLineArguments(":linkMainDebugExecutableLinux64") { arguments ->
val parsedArguments = parseCommandLineArguments<K2NativeCompilerArguments>(arguments)
assertEquals(listOf("-L."), parsedArguments.singleLinkerArguments?.toList())
assertTrue(arguments.containsSequentially("-linker-option", "-L."))
}
}
@@ -1558,7 +1562,8 @@ open class NewMultiplatformIT : BaseGradleIT() {
).flatMapTo(mutableSetOf()) { target ->
listOf("main", "test").map { compilation ->
Triple(target, compilation,
"$target${compilation.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}")
"$target${compilation.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}"
)
}
} + Triple("metadata", "main", "commonMain")
@@ -219,7 +219,7 @@ constructor(
null, BitcodeEmbeddingMode.DISABLE -> Unit
}
args.linkerArguments = linkerOpts.toTypedArray()
args.singleLinkerArguments = linkerOpts.toTypedArray()
args.binaryOptions = binaryOptions.map { (key, value) -> "$key=$value" }.toTypedArray()
args.staticFramework = isStaticFramework