diff --git a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt index 135eb91fc9a..e327384d630 100644 --- a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt +++ b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt @@ -136,6 +136,9 @@ open class CInteropArguments(argParser: ArgParser = val userSetupHint by argParser.option(ArgType.String, USER_SETUP_HINT, description = "A suggestion that is displayed to the user if produced lib fails to link") + + val disableExperimentalAnnotation by argParser.option(ArgType.Boolean, "Xdisable-experimental-annotation", + description = "Don't add @ExperimentalForeignApi to generated Kotlin declarations") } class JSInteropArguments(argParser: ArgParser = ArgParser("jsinterop", diff --git a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/InteropConfiguration.kt b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/InteropConfiguration.kt index e82e37083a2..1fd8416e1be 100644 --- a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/InteropConfiguration.kt +++ b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/InteropConfiguration.kt @@ -32,6 +32,7 @@ class InteropConfiguration( val noStringConversion: Set, val exportForwardDeclarations: List, val disableDesignatedInitializerChecks: Boolean, + val disableExperimentalAnnotation: Boolean, val target: KonanTarget ) diff --git a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/main.kt b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/main.kt index c0dc5d52bc9..ff7843c0633 100644 --- a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/main.kt +++ b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/main.kt @@ -326,6 +326,7 @@ private fun processCLib( noStringConversion = def.config.noStringConversion.toSet(), exportForwardDeclarations = def.config.exportForwardDeclarations, disableDesignatedInitializerChecks = def.config.disableDesignatedInitializerChecks, + disableExperimentalAnnotation = cinteropArguments.disableExperimentalAnnotation ?: false, target = target )