Provide a forced compiler version compatibility -X control.
This commit is contained in:
committed by
alexander-gorshenev
parent
0786cc3e76
commit
30fd4060d3
@@ -175,6 +175,9 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
|||||||
put(LIST_PHASES, arguments.listPhases)
|
put(LIST_PHASES, arguments.listPhases)
|
||||||
put(TIME_PHASES, arguments.timePhases)
|
put(TIME_PHASES, arguments.timePhases)
|
||||||
|
|
||||||
|
put(COMPATIBLE_COMPILER_VERSIONS,
|
||||||
|
arguments.compatibleCompilerVersions.toNonNullList())
|
||||||
|
|
||||||
put(ENABLE_ASSERTIONS, arguments.enableAssertions)
|
put(ENABLE_ASSERTIONS, arguments.enableAssertions)
|
||||||
|
|
||||||
put(GENERATE_TEST_RUNNER, arguments.generateTestRunner)
|
put(GENERATE_TEST_RUNNER, arguments.generateTestRunner)
|
||||||
|
|||||||
@@ -81,12 +81,15 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
|||||||
var target: String? = null
|
var target: String? = null
|
||||||
|
|
||||||
// The rest of the options are only interesting to the developers.
|
// The rest of the options are only interesting to the developers.
|
||||||
// Make sure to prepend them with a double dash.
|
// Make sure to prepend them with -X.
|
||||||
// Keep the list lexically sorted.
|
// Keep the list lexically sorted.
|
||||||
|
|
||||||
@Argument(value="-Xcheck-dependencies", deprecatedName = "--check_dependencies", description = "Check dependencies and download the missing ones")
|
@Argument(value="-Xcheck-dependencies", deprecatedName = "--check_dependencies", description = "Check dependencies and download the missing ones")
|
||||||
var checkDependencies: Boolean = false
|
var checkDependencies: Boolean = false
|
||||||
|
|
||||||
|
@Argument(value="-Xcompatible-compiler-version", valueDescription = "<version>", description = "Assume the given compiler version to be binary compatible")
|
||||||
|
var compatibleCompilerVersions: Array<String>? = null
|
||||||
|
|
||||||
@Argument(value = "-Xdisable", deprecatedName = "--disable", valueDescription = "<Phase>", description = "Disable backend phase")
|
@Argument(value = "-Xdisable", deprecatedName = "--disable", valueDescription = "<Phase>", description = "Disable backend phase")
|
||||||
var disablePhases: Array<String>? = null
|
var disablePhases: Array<String>? = null
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -21,7 +21,9 @@ import org.jetbrains.kotlin.konan.library.libraryResolver
|
|||||||
import org.jetbrains.kotlin.konan.properties.loadProperties
|
import org.jetbrains.kotlin.konan.properties.loadProperties
|
||||||
import org.jetbrains.kotlin.konan.target.*
|
import org.jetbrains.kotlin.konan.target.*
|
||||||
import org.jetbrains.kotlin.konan.KonanAbiVersion
|
import org.jetbrains.kotlin.konan.KonanAbiVersion
|
||||||
|
import org.jetbrains.kotlin.konan.KonanVersion
|
||||||
import org.jetbrains.kotlin.konan.library.toUnresolvedLibraries
|
import org.jetbrains.kotlin.konan.library.toUnresolvedLibraries
|
||||||
|
import org.jetbrains.kotlin.konan.parseKonanVersion
|
||||||
|
|
||||||
class KonanConfig(val project: Project, val configuration: CompilerConfiguration) {
|
class KonanConfig(val project: Project, val configuration: CompilerConfiguration) {
|
||||||
|
|
||||||
@@ -76,12 +78,16 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
|||||||
private val repositories = configuration.getList(KonanConfigKeys.REPOSITORIES)
|
private val repositories = configuration.getList(KonanConfigKeys.REPOSITORIES)
|
||||||
private fun resolverLogger(msg: String) = configuration.report(STRONG_WARNING, msg)
|
private fun resolverLogger(msg: String) = configuration.report(STRONG_WARNING, msg)
|
||||||
|
|
||||||
|
private val compatibleCompilerVersions: List<KonanVersion> =
|
||||||
|
configuration.getList(KonanConfigKeys.COMPATIBLE_COMPILER_VERSIONS).map { it.parseKonanVersion() }
|
||||||
|
|
||||||
private val resolver = defaultResolver(
|
private val resolver = defaultResolver(
|
||||||
repositories,
|
repositories,
|
||||||
libraryNames.filter { it.contains(File.separator) },
|
libraryNames.filter { it.contains(File.separator) },
|
||||||
target,
|
target,
|
||||||
distribution,
|
distribution,
|
||||||
::resolverLogger
|
::resolverLogger,
|
||||||
|
compatibleCompilerVersions = compatibleCompilerVersions
|
||||||
).libraryResolver()
|
).libraryResolver()
|
||||||
|
|
||||||
internal val resolvedLibraries by lazy {
|
internal val resolvedLibraries by lazy {
|
||||||
|
|||||||
+2
@@ -14,6 +14,8 @@ class KonanConfigKeys {
|
|||||||
// Keep the list lexically sorted.
|
// Keep the list lexically sorted.
|
||||||
val CHECK_DEPENDENCIES: CompilerConfigurationKey<Boolean>
|
val CHECK_DEPENDENCIES: CompilerConfigurationKey<Boolean>
|
||||||
= CompilerConfigurationKey.create("check dependencies and download the missing ones")
|
= CompilerConfigurationKey.create("check dependencies and download the missing ones")
|
||||||
|
val COMPATIBLE_COMPILER_VERSIONS: CompilerConfigurationKey<List<String>>
|
||||||
|
= CompilerConfigurationKey.create("compatible compiler versions")
|
||||||
val DEBUG: CompilerConfigurationKey<Boolean>
|
val DEBUG: CompilerConfigurationKey<Boolean>
|
||||||
= CompilerConfigurationKey.create("add debug information")
|
= CompilerConfigurationKey.create("add debug information")
|
||||||
val DISABLED_PHASES: CompilerConfigurationKey<List<String>>
|
val DISABLED_PHASES: CompilerConfigurationKey<List<String>>
|
||||||
|
|||||||
@@ -39,13 +39,14 @@ fun defaultResolver(
|
|||||||
target: KonanTarget,
|
target: KonanTarget,
|
||||||
distribution: Distribution,
|
distribution: Distribution,
|
||||||
logger: Logger = ::dummyLogger,
|
logger: Logger = ::dummyLogger,
|
||||||
skipCurrentDir: Boolean = false
|
skipCurrentDir: Boolean = false,
|
||||||
|
compatibleCompilerVersions: List<KonanVersion> = emptyList()
|
||||||
): SearchPathResolverWithTarget = KonanLibraryProperResolver(
|
): SearchPathResolverWithTarget = KonanLibraryProperResolver(
|
||||||
repositories,
|
repositories,
|
||||||
directLibs,
|
directLibs,
|
||||||
target,
|
target,
|
||||||
listOf(KonanAbiVersion.CURRENT),
|
listOf(KonanAbiVersion.CURRENT),
|
||||||
listOf(KonanVersion.CURRENT),
|
listOf(KonanVersion.CURRENT) + compatibleCompilerVersions,
|
||||||
distribution.klib,
|
distribution.klib,
|
||||||
distribution.localKonanDir.absolutePath,
|
distribution.localKonanDir.absolutePath,
|
||||||
skipCurrentDir,
|
skipCurrentDir,
|
||||||
|
|||||||
Reference in New Issue
Block a user