Skip to content

Commit a3634bd

Browse files
Abduqodiri Qurbonzodaqurbonzoda
authored andcommitted
Fix compiler warning: Opt-in requirement marker is unresolved
kotlin.native.runtime.NativeRuntimeApi and kotlinx.cinterop.ExperimentalForeignApi opt-in requirement markers are native-only and thus not found in other modules.
1 parent 61a71f2 commit a3634bd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

runtime/build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ kotlin {
5454
resources.srcDirs = ["$it.name/resources"]
5555
languageSettings {
5656
progressiveMode = true
57-
optIn('kotlin.experimental.ExperimentalNativeApi')
58-
optIn("kotlin.native.runtime.NativeRuntimeApi")
59-
optIn("kotlinx.cinterop.ExperimentalForeignApi")
6057
}
6158
}
6259

@@ -109,3 +106,11 @@ if (project.findProperty("publication_repository") == "space") {
109106
tasks.withType(KotlinNativeCompile).matching { it.name.toLowerCase().contains("test") }.configureEach {
110107
it.dependsOn(tasks.withType(Sign))
111108
}
109+
110+
tasks.withType(KotlinNativeCompile).configureEach {
111+
compilerOptions.freeCompilerArgs.addAll(
112+
"-opt-in=kotlin.experimental.ExperimentalNativeApi",
113+
"-opt-in=kotlin.native.runtime.NativeRuntimeApi",
114+
"-opt-in=kotlinx.cinterop.ExperimentalForeignApi",
115+
)
116+
}

0 commit comments

Comments
 (0)