Gradle, native: Embed bitcode for watchOS and tvOS
This commit is contained in:
+1
-6
@@ -215,12 +215,7 @@ class Framework(
|
|||||||
/**
|
/**
|
||||||
* Embed bitcode for the framework or not. See [BitcodeEmbeddingMode].
|
* Embed bitcode for the framework or not. See [BitcodeEmbeddingMode].
|
||||||
*/
|
*/
|
||||||
var embedBitcode: BitcodeEmbeddingMode =
|
var embedBitcode: BitcodeEmbeddingMode = buildType.embedBitcode(target.konanTarget)
|
||||||
if (target.konanTarget == KonanTarget.IOS_ARM64 || target.konanTarget == KonanTarget.IOS_ARM32) {
|
|
||||||
buildType.iosEmbedBitcode
|
|
||||||
} else {
|
|
||||||
BitcodeEmbeddingMode.DISABLE
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable embedding bitcode for the framework. See [BitcodeEmbeddingMode].
|
* Enable or disable embedding bitcode for the framework. See [BitcodeEmbeddingMode].
|
||||||
|
|||||||
+12
-2
@@ -3,20 +3,30 @@ package org.jetbrains.kotlin.gradle.plugin.mpp
|
|||||||
|
|
||||||
import org.gradle.api.Named
|
import org.gradle.api.Named
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework.BitcodeEmbeddingMode
|
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework.BitcodeEmbeddingMode
|
||||||
|
import org.jetbrains.kotlin.konan.target.Architecture.ARM32
|
||||||
|
import org.jetbrains.kotlin.konan.target.Architecture.ARM64
|
||||||
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
||||||
import org.jetbrains.kotlin.konan.target.Family
|
import org.jetbrains.kotlin.konan.target.Family.*
|
||||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||||
|
|
||||||
enum class NativeBuildType(
|
enum class NativeBuildType(
|
||||||
val optimized: Boolean,
|
val optimized: Boolean,
|
||||||
val debuggable: Boolean,
|
val debuggable: Boolean,
|
||||||
internal val iosEmbedBitcode: BitcodeEmbeddingMode
|
private val embedBitcodeForAppleDevices: BitcodeEmbeddingMode
|
||||||
) : Named {
|
) : Named {
|
||||||
RELEASE(true, false, BitcodeEmbeddingMode.BITCODE),
|
RELEASE(true, false, BitcodeEmbeddingMode.BITCODE),
|
||||||
DEBUG(false, true, BitcodeEmbeddingMode.MARKER);
|
DEBUG(false, true, BitcodeEmbeddingMode.MARKER);
|
||||||
|
|
||||||
override fun getName(): String = name.toLowerCase()
|
override fun getName(): String = name.toLowerCase()
|
||||||
|
|
||||||
|
fun embedBitcode(target: KonanTarget) = with(target) {
|
||||||
|
if (family in listOf(IOS, WATCHOS, TVOS) && architecture in listOf(ARM32, ARM64)) {
|
||||||
|
embedBitcodeForAppleDevices
|
||||||
|
} else {
|
||||||
|
BitcodeEmbeddingMode.DISABLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val DEFAULT_BUILD_TYPES = setOf(DEBUG, RELEASE)
|
val DEFAULT_BUILD_TYPES = setOf(DEBUG, RELEASE)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user