[K/N] Pass USE_FIR config setting to splitted first stage, and not to second stage

Merge-request: KT-MR-11084
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2023-07-14 15:23:27 +00:00
committed by Space Team
parent edc7df517c
commit 52068e11ee
2 changed files with 5 additions and 0 deletions
@@ -137,6 +137,9 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
spawnedConfiguration.setupCommonArguments(spawnedArguments, this@K2Native::createMetadataVersion)
spawnedConfiguration.setupFromArguments(spawnedArguments)
spawnedConfiguration.setupPartialLinkageConfig(configuration.partialLinkageConfig)
configuration.get(CommonConfigurationKeys.USE_FIR)?.let {
spawnedConfiguration.put(CommonConfigurationKeys.USE_FIR, it)
}
configuration.get(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS)?.let {
spawnedConfiguration.put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, it)
}
@@ -166,6 +166,8 @@ class KonanDriver(
// For the second stage, remove already compiled source files from the configuration.
configuration.put(CLIConfigurationKeys.CONTENT_ROOTS, listOf())
// Frontend version must not be passed to 2nd stage (same as Gradle plugin does when calling CLI compiler), since there are no sources anymore
configuration.put(CommonConfigurationKeys.USE_FIR, false)
// For the second stage, provide just compiled intermediate KLib as "-Xinclude=" param.
require(intermediateKLib.exists) { "Intermediate KLib $intermediateKLib must have been created by successful first compilation stage" }
configuration.put(KonanConfigKeys.INCLUDED_LIBRARIES,