[KLIB] Lift up -Xmetadata-klib CLI key from Native to Common args

This is a precondition for obsoleting and finally removing
`-Xexpect-actual-linker` CLI key, which became useless since
the removal of ExpectActualTable.

^KT-61136
This commit is contained in:
Dmitriy Dolovov
2023-09-15 18:53:28 +02:00
committed by Space Team
parent 53f994263f
commit 848c88b1a5
14 changed files with 25 additions and 12 deletions
@@ -48,6 +48,7 @@ fun copyCommonCompilerArguments(from: CommonCompilerArguments, to: CommonCompile
to.languageVersion = from.languageVersion
to.legacySmartCastAfterTry = from.legacySmartCastAfterTry
to.listPhases = from.listPhases
to.metadataKlib = from.metadataKlib
to.metadataVersion = from.metadataVersion
to.multiPlatform = from.multiPlatform
to.newInference = from.newInference
@@ -63,7 +63,6 @@ fun copyK2NativeCompilerArguments(from: K2NativeCompilerArguments, to: K2NativeC
to.makePerFileCache = from.makePerFileCache
to.manifestFile = from.manifestFile
to.memoryModel = from.memoryModel
to.metadataKlib = from.metadataKlib
to.moduleName = from.moduleName
to.nativeLibraries = from.nativeLibraries?.copyOf()
to.noObjcGenerics = from.noObjcGenerics
@@ -572,6 +572,17 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
field = value
}
@Argument(
value = "-Xmetadata-klib",
description = "Produce a klib that only contains the declarations metadata"
)
var metadataKlib: Boolean = false
set(value) {
checkFrozen()
field = value
}
/** TODO: replace by [metadataKlib] */
@Argument(
value = "-Xexpect-actual-linker",
description = "Enable experimental expect/actual linker"
@@ -369,9 +369,6 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value="-Xallocator", valueDescription = "std | mimalloc | custom", description = "Allocator used in runtime")
var allocator: String? = null
@Argument(value = "-Xmetadata-klib", description = "Produce a klib that only contains the declarations metadata")
var metadataKlib: Boolean = false
@Argument(
value = "-Xheader-klib-path",
description = "Save a klib that only contains the public abi to the given path"