Native: add -Xdisable-experimental-annotation flag to cinterop
It disables adding `ExperimentalForeignApi` opt-in to declarations generated by cinterop. Main use case is platform libraries, which are not supposed to have this annotation. Applying the flag to user cinterop libraries is discouraged and effectively means opting in. ^KT-58362
This commit is contained in:
committed by
Space Team
parent
1053d18871
commit
cabb25d3e0
+3
@@ -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",
|
||||
|
||||
+1
@@ -32,6 +32,7 @@ class InteropConfiguration(
|
||||
val noStringConversion: Set<String>,
|
||||
val exportForwardDeclarations: List<String>,
|
||||
val disableDesignatedInitializerChecks: Boolean,
|
||||
val disableExperimentalAnnotation: Boolean,
|
||||
val target: KonanTarget
|
||||
)
|
||||
|
||||
|
||||
+1
@@ -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
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user