[K/N] Require small binaries for all watchos targets

This commit is contained in:
Pavel Kunyavskiy
2022-09-15 17:19:58 +02:00
committed by Space
parent 46afb46a6d
commit 7293dd6d65
4 changed files with 8 additions and 4 deletions
@@ -54,7 +54,7 @@ sealed class ClangArgs(
"HAS_FOUNDATION_FRAMEWORK".takeIf { target.hasFoundationFramework() },
"HAS_UIKIT_FRAMEWORK".takeIf { target.hasUIKitFramework() },
"REPORT_BACKTRACE_TO_IOS_CRASH_LOG".takeIf { target.supportsIosCrashLog() },
"NEAD_SMALL_BINARY".takeIf { target.needSmallBinary() },
"NEED_SMALL_BINARY".takeIf { target.needSmallBinary() },
"TARGET_HAS_ADDRESS_DEPENDENCY".takeIf { target.hasAddressDependencyInMemoryModel() },
).map { "KONAN_$it=1" }
val otherOptions = listOfNotNull(
@@ -143,7 +143,11 @@ fun KonanTarget.supportsUnalignedAccess(): Boolean = when (architecture) {
Architecture.X86, Architecture.ARM64, Architecture.X64 -> true
} && this != KonanTarget.WATCHOS_ARM64
fun KonanTarget.needSmallBinary() = (architecture == Architecture.ARM32 && family.isAppleFamily)
fun KonanTarget.needSmallBinary() = when {
family == Family.WATCHOS -> true
family.isAppleFamily -> architecture == Architecture.ARM32
else -> false
}
fun KonanTarget.supportedSanitizers(): List<SanitizerKind> =
when(this) {