Skip to content

Commit 0ceadc5

Browse files
sbogolepovSpace Team
authored and
Space Team
committed
[K/N] Fix KT-59167
1 parent 45e56f9 commit 0ceadc5

File tree

1 file changed

+15
-0
lines changed
  • native/utils/src/org/jetbrains/kotlin/konan/target

1 file changed

+15
-0
lines changed

native/utils/src/org/jetbrains/kotlin/konan/target/ClangArgs.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,21 @@ sealed class ClangArgs(
136136
// See KT-43502.
137137
add(listOf("-fPIC"))
138138
}
139+
// See https://github.com/apple/llvm-project/commit/dfa99c49306262eac46becbf1f7f5ba33ecc2fe3
140+
// TL;DR: This commit adds an OS-agnostic __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ macro and now
141+
// some of the Xcode headers use it instead of platform-specific ones. Workaround this problem
142+
// by manually setting this macro.
143+
// YouTrack ticket: KT-59167
144+
val environmentOsVersionMinRequired = when (target.family) {
145+
Family.OSX -> "__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__"
146+
Family.IOS -> "__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__"
147+
Family.TVOS -> "__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__"
148+
Family.WATCHOS -> "__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__"
149+
else -> null
150+
}
151+
if (environmentOsVersionMinRequired != null) {
152+
add(listOf("-D__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__=$environmentOsVersionMinRequired"))
153+
}
139154
}.flatten()
140155

141156
private val specificClangArgs: List<String> = when (target) {

0 commit comments

Comments
 (0)