Don't embed bitcode for ios simulator
This commit is contained in:
+14
-2
@@ -948,7 +948,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
if (HostManager.hostIsMac) {
|
||||
|
||||
// Check dependency exporting and bitcode embedding in frameworks.
|
||||
// For release builds
|
||||
// For release builds.
|
||||
build("linkReleaseFrameworkIos") {
|
||||
assertSuccessful()
|
||||
assertFileExists("build/bin/ios/releaseFramework/native_binary.framework")
|
||||
@@ -961,7 +961,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
// For debug builds
|
||||
// For debug builds.
|
||||
build("linkDebugFrameworkIos") {
|
||||
assertSuccessful()
|
||||
assertFileExists("build/bin/ios/debugFramework/native_binary.framework")
|
||||
@@ -985,6 +985,18 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
// Check that bitcode is disabled for iOS simulator.
|
||||
build("linkReleaseFrameworkIosSim", "linkDebugFrameworkIosSim") {
|
||||
assertSuccessful()
|
||||
assertFileExists("build/bin/iosSim/releaseFramework/native-binary.framework")
|
||||
assertFileExists("build/bin/iosSim/debugFramework/native-binary.framework")
|
||||
checkFrameworkCompilationCommandLine {
|
||||
assertFalse(it.contains("-Xembed-bitcode"))
|
||||
assertFalse(it.contains("-Xembed-bitcode-marker"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check that plugin doesn't allow exporting dependencies not added in the API configuration.
|
||||
val buildFile = listOf("build.gradle", "build.gradle.kts").map { projectDir.resolve(it) }.single { it.exists() }
|
||||
buildFile.modify {
|
||||
|
||||
+5
@@ -81,5 +81,10 @@ kotlin {
|
||||
}
|
||||
}
|
||||
}
|
||||
iosX64("iosSim") {
|
||||
binaries {
|
||||
framework()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -73,4 +73,10 @@ kotlin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iosX64("iosSim") {
|
||||
binaries {
|
||||
framework()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-5
@@ -207,11 +207,12 @@ class Framework(
|
||||
/**
|
||||
* Embed bitcode for the framework or not. See [BitcodeEmbeddingMode].
|
||||
*/
|
||||
var embedBitcode: BitcodeEmbeddingMode = if (target.konanTarget.family == Family.IOS) {
|
||||
buildType.iosEmbedBitcode
|
||||
} else {
|
||||
BitcodeEmbeddingMode.DISABLE
|
||||
}
|
||||
var embedBitcode: BitcodeEmbeddingMode =
|
||||
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].
|
||||
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
package org.jetbrains.kotlin.gradle.plugin.mpp
|
||||
|
||||
import org.gradle.api.Named
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework.BitcodeEmbeddingMode
|
||||
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
||||
import org.jetbrains.kotlin.konan.target.Family
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||
@@ -8,10 +9,10 @@ import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||
enum class NativeBuildType(
|
||||
val optimized: Boolean,
|
||||
val debuggable: Boolean,
|
||||
internal val iosEmbedBitcode: Framework.BitcodeEmbeddingMode
|
||||
internal val iosEmbedBitcode: BitcodeEmbeddingMode
|
||||
) : Named {
|
||||
RELEASE(true, false, Framework.BitcodeEmbeddingMode.BITCODE),
|
||||
DEBUG(false, true, Framework.BitcodeEmbeddingMode.MARKER);
|
||||
RELEASE(true, false, BitcodeEmbeddingMode.BITCODE),
|
||||
DEBUG(false, true, BitcodeEmbeddingMode.MARKER);
|
||||
|
||||
override fun getName(): String = name.toLowerCase()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user