We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5645873 commit 87cbd1eCopy full SHA for 87cbd1e
Sources/SwiftlyCore/Platform.swift
@@ -200,6 +200,16 @@ extension Platform {
200
for (key, value) in env {
201
newEnv[key] = value
202
}
203
+
204
+#if os(macOS)
205
+ // On macOS, we try to set SDKROOT if its empty for tools like clang++ that need it to
206
+ // find standard libraries that aren't in the toolchain, like libc++. Here we
207
+ // use xcrun to tell us what the default sdk root should be.
208
+ if newEnv["SDKROOT"] == nil {
209
+ newEnv["SDKROOT"] = (try? await self.runProgramOutput("/usr/bin/xcrun", "--show-sdk-path"))
210
+ }
211
+#endif
212
213
try self.runProgram([command] + arguments, env: newEnv)
214
215
0 commit comments