[K/N] Add xcodeOverride to Xcode in native-utils ^KTI-1553

- findCurrent() is used by the build of Kotlin/Native compiler itself.
  It happens indirectly, via AppleConfigurables.
- CurrentXcode invokes xcrun command line tool in its implementation.
- Configuration cache prohibits calling external commands

All three factors combined make K/N compiler build incompatible with CC.

By using xcodeOverride, K/N compiler build can provide its own Xcode
instance avoiding calling external commands when it's not allowed by CC.
This commit is contained in:
Alexander Shabalin
2024-02-22 11:45:27 +01:00
committed by Space Team
parent 1d9129f688
commit edf8dc0421
@@ -83,7 +83,11 @@ interface Xcode {
val current: Xcode
get() = findCurrent()
fun findCurrent(): Xcode = CurrentXcode()
var xcodeOverride: Xcode? = null
fun findCurrent(): Xcode = xcodeOverride ?: defaultCurrent()
fun defaultCurrent(): Xcode = CurrentXcode()
}
}