Skip to content

Commit

Permalink
Add an explicit error that SKIE does not support bitcode embedding.
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipDolnik committed Mar 6, 2024
1 parent 1100126 commit 4cc10ac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import co.touchlab.skie.phases.other.ExtraClassExportPhase
import co.touchlab.skie.phases.other.FixDuplicatedOverridenFunctionsPhase
import co.touchlab.skie.phases.other.FixLibrariesShortNamePhase
import co.touchlab.skie.phases.other.VerifyMinOSVersionPhase
import co.touchlab.skie.phases.other.VerifyNoBitcodeEmbeddingPhase
import co.touchlab.skie.phases.runtime.ConfigureStableNameTypeAliasesForKotlinRuntimePhase
import co.touchlab.skie.phases.runtime.KotlinRuntimeHidingPhase
import co.touchlab.skie.phases.runtime.SwiftRuntimeGenerator
Expand Down Expand Up @@ -78,6 +79,7 @@ class SkiePhaseScheduler {
ClassExportAnalyticsPhase,
ExtraClassExportPhase(context),
VerifyMinOSVersionPhase,
VerifyNoBitcodeEmbeddingPhase,
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package co.touchlab.skie.phases.other

import co.touchlab.skie.phases.ClassExportPhase
import org.jetbrains.kotlin.backend.konan.BitcodeEmbedding
import org.jetbrains.kotlin.backend.konan.KonanConfigKeys

object VerifyNoBitcodeEmbeddingPhase : ClassExportPhase {

context(ClassExportPhase.Context)
override fun execute() {
val bitcodeEmbeddingMode = compilerConfiguration[KonanConfigKeys.BITCODE_EMBEDDING_MODE]

if (bitcodeEmbeddingMode == BitcodeEmbedding.Mode.FULL) {
error(
"Bitcode embedding is not supported by SKIE. " +
"To disable bitcode embedding you likely need to remove `embedBitcode(BitcodeEmbeddingMode.BITCODE)` from the Gradle build script.",
)
}
}
}

0 comments on commit 4cc10ac

Please sign in to comment.