[K/N][gradle] Supported friend modules for two stage compilation
Fixes https://youtrack.jetbrains.com/issue/KT-49248
This commit is contained in:
+6
@@ -77,6 +77,7 @@ internal fun buildKotlinNativeBinaryLinkerArgs(
|
||||
target: KonanTarget,
|
||||
outputKind: CompilerOutputKind,
|
||||
libraries: List<File>,
|
||||
friendModule: FileCollection,
|
||||
|
||||
languageSettings: LanguageSettings,
|
||||
enableEndorsedLibs: Boolean,
|
||||
@@ -111,6 +112,11 @@ internal fun buildKotlinNativeBinaryLinkerArgs(
|
||||
|
||||
exportLibraries.forEach { add("-Xexport-library=${it.absolutePath}") }
|
||||
includeLibraries.forEach { add("-Xinclude=${it.absolutePath}") }
|
||||
|
||||
val friends = friendModule.files
|
||||
if (friends.isNotEmpty()) {
|
||||
addArg("-friend-modules", friends.joinToString(File.pathSeparator) { it.absolutePath })
|
||||
}
|
||||
}
|
||||
|
||||
private fun buildKotlinNativeMainArgs(
|
||||
|
||||
+6
-4
@@ -168,6 +168,11 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : Kotl
|
||||
else objects.fileCollection()
|
||||
}
|
||||
|
||||
@get:Classpath
|
||||
protected val friendModule: FileCollection by project.provider {
|
||||
project.files(compilation.friendPaths)
|
||||
}
|
||||
|
||||
@Deprecated("For native tasks use 'libraries' instead", ReplaceWith("libraries"))
|
||||
override fun getClasspath(): FileCollection = libraries
|
||||
override fun setClasspath(configuration: FileCollection?) {
|
||||
@@ -354,10 +359,6 @@ constructor(
|
||||
private val commonSourcesTree: FileTree
|
||||
get() = commonSources.asFileTree
|
||||
|
||||
|
||||
private val friendModule: FileCollection by project.provider {
|
||||
project.files(compilation.friendPaths)
|
||||
}
|
||||
// endregion.
|
||||
|
||||
// region Language settings imported from a SourceSet.
|
||||
@@ -634,6 +635,7 @@ constructor(
|
||||
konanTarget,
|
||||
outputKind,
|
||||
libraries.files.filterKlibsPassedToCompiler(),
|
||||
friendModule,
|
||||
languageSettings,
|
||||
enableEndorsedLibs,
|
||||
localKotlinOptions,
|
||||
|
||||
Reference in New Issue
Block a user