[K2/Native] Configure metadata compilation mode

This fixes access to internal declarations in common source sets from
intermediate source sets that are compiled to metadata.

#KT-58219 Fixed
This commit is contained in:
Kirill Rakhman
2023-04-26 11:00:03 +02:00
committed by Space Team
parent aea8670c12
commit 6d3b911dfc
6 changed files with 56 additions and 3 deletions
@@ -159,13 +159,14 @@ fun <F> prepareNativeSessions(
resolvedLibraries: List<KotlinResolvedLibrary>,
libraryList: DependencyListForCliModule,
extensionRegistrars: List<FirExtensionRegistrar>,
metadataCompilationMode: Boolean,
isCommonSource: (F) -> Boolean,
fileBelongsToModule: (F, String) -> Boolean,
registerExtraComponents: ((FirSession) -> Unit) = {},
): List<SessionWithSources<F>> {
return prepareSessions(
files, configuration, rootModuleName, NativePlatforms.unspecifiedNativePlatform, NativePlatformAnalyzerServices,
metadataCompilationMode = false, libraryList, isCommonSource, fileBelongsToModule, createLibrarySession = { sessionProvider ->
metadataCompilationMode, libraryList, isCommonSource, fileBelongsToModule, createLibrarySession = { sessionProvider ->
FirNativeSessionFactory.createLibrarySession(
rootModuleName,
resolvedLibraries,