[Platform libs] Store def files in distribution on per-target basis
This commit is contained in:
committed by
Ilya Matveev
parent
76b0e42de4
commit
3334b9b3ad
+16
-3
@@ -74,6 +74,14 @@ ext {
|
|||||||
]
|
]
|
||||||
cacheableTargetNames = cacheableTargets.collect { it.visibleName }
|
cacheableTargetNames = cacheableTargets.collect { it.visibleName }
|
||||||
|
|
||||||
|
// Some targets miss zlib in their sysroots.
|
||||||
|
// We skip these targets when generate a corresponding platform library.
|
||||||
|
// See also: the :distDef task, targetDefFiles in the :platformLibs project.
|
||||||
|
targetsWithoutZlib = [
|
||||||
|
KonanTarget.LINUX_MIPS32.INSTANCE,
|
||||||
|
KonanTarget.LINUX_MIPSEL32.INSTANCE
|
||||||
|
]
|
||||||
|
|
||||||
kotlinCompilerModule="org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}"
|
kotlinCompilerModule="org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}"
|
||||||
kotlinStdLibModule="org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
|
kotlinStdLibModule="org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
|
||||||
kotlinCommonStdlibModule="org.jetbrains.kotlin:kotlin-stdlib-common:${kotlinStdlibVersion}:sources"
|
kotlinCommonStdlibModule="org.jetbrains.kotlin:kotlin-stdlib-common:${kotlinStdlibVersion}:sources"
|
||||||
@@ -388,9 +396,14 @@ task distDef(type: Copy) {
|
|||||||
|
|
||||||
destinationDir distDir
|
destinationDir distDir
|
||||||
|
|
||||||
from(project("platformLibs").file("src/platform")) {
|
platformManager.targetValues.each { target ->
|
||||||
into('konan/platformDef')
|
from(project("platformLibs").file("src/platform/${target.family.name().toLowerCase()}")) {
|
||||||
include '**/*.def'
|
into("konan/platformDef/${target.visibleName}")
|
||||||
|
include '**/*.def'
|
||||||
|
if (target in targetsWithoutZlib) {
|
||||||
|
exclude '**/zlib.def'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ private ArrayList<DefFile> targetDefFiles(KonanTarget target) {
|
|||||||
.findAll { it.name.endsWith(".def") }
|
.findAll { it.name.endsWith(".def") }
|
||||||
// The libz.a/libz.so and zlib.h are missing in MIPS sysroots.
|
// The libz.a/libz.so and zlib.h are missing in MIPS sysroots.
|
||||||
// Just workaround it until we have sysroots corrected.
|
// Just workaround it until we have sysroots corrected.
|
||||||
.findAll { ! ((target instanceof KonanTarget.LINUX_MIPS32 ||
|
.findAll { ! ((target in targetsWithoutZlib) && it.name == 'zlib.def') }
|
||||||
target instanceof KonanTarget.LINUX_MIPSEL32) && it.name == 'zlib.def') }
|
|
||||||
.collect { DefFileKt.DefFile(it, target) }
|
.collect { DefFileKt.DefFile(it, target) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -69,7 +69,7 @@ fun generatePlatformLibraries(args: Array<String>) {
|
|||||||
val inputDirectoryPath by argParser.option(
|
val inputDirectoryPath by argParser.option(
|
||||||
ArgType.String,
|
ArgType.String,
|
||||||
"input-directory", "i",
|
"input-directory", "i",
|
||||||
"Input directory. Default value is <dist>/konan/platformDef/<target_family>"
|
"Input directory. Default value is <dist>/konan/platformDef/<target>"
|
||||||
)
|
)
|
||||||
val outputDirectoryPath by argParser.option(
|
val outputDirectoryPath by argParser.option(
|
||||||
ArgType.String,
|
ArgType.String,
|
||||||
@@ -123,7 +123,7 @@ fun generatePlatformLibraries(args: Array<String>) {
|
|||||||
val target = HostManager(distribution).targetByName(targetName)
|
val target = HostManager(distribution).targetByName(targetName)
|
||||||
|
|
||||||
val inputDirectory = inputDirectoryPath?.File()
|
val inputDirectory = inputDirectoryPath?.File()
|
||||||
?: File(distribution.konanSubdir, "platformDef").child(target.family.visibleName)
|
?: File(distribution.konanSubdir, "platformDef").child(target.visibleName)
|
||||||
|
|
||||||
val outputDirectory = outputDirectoryPath?.File()
|
val outputDirectory = outputDirectoryPath?.File()
|
||||||
?: File(distribution.klib, "platform").child(target.visibleName)
|
?: File(distribution.klib, "platform").child(target.visibleName)
|
||||||
|
|||||||
Reference in New Issue
Block a user