[Native] Support Xcode 15.3 — add back the TargetConditional.h macros

^KT-65542
This commit is contained in:
Timofey Solonin
2024-02-02 16:10:07 +01:00
committed by Space Team
parent 69426e2129
commit 55e61f6631
@@ -134,6 +134,31 @@ sealed class ClangArgs(
if (environmentOsVersionMinRequired != null) {
add(listOf("-D__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__=$environmentOsVersionMinRequired"))
}
val targetConditionals = when (target) {
KonanTarget.MACOS_ARM64, KonanTarget.MACOS_X64 -> hashMapOf(
"TARGET_OS_OSX" to "1",
)
KonanTarget.IOS_ARM64 -> hashMapOf(
"TARGET_OS_EMBEDDED" to "1",
"TARGET_OS_IPHONE" to "1",
"TARGET_OS_IOS" to "1",
)
KonanTarget.TVOS_ARM64 -> hashMapOf(
"TARGET_OS_EMBEDDED" to "1",
"TARGET_OS_IPHONE" to "1",
"TARGET_OS_TV" to "1",
)
KonanTarget.WATCHOS_ARM64, KonanTarget.WATCHOS_ARM32, KonanTarget.WATCHOS_DEVICE_ARM64 -> hashMapOf(
"TARGET_OS_EMBEDDED" to "1",
"TARGET_OS_IPHONE" to "1",
"TARGET_OS_WATCH" to "1",
)
else -> null
}
if (targetConditionals != null) {
add(targetConditionals.map { "-D${it.key}=${it.value}" })
}
}.flatten()
private val specificClangArgs: List<String> = when (target) {