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 cdddd4e commit 7635eeaCopy full SHA for 7635eea
Sources/SwiftlyCore/Platform.swift
@@ -210,6 +210,15 @@ extension Platform {
210
newEnv[key] = value
211
}
212
213
+#if os(macOS)
214
+ // On macOS, we try to set SDKROOT if its empty for tools like clang++ that need it to
215
+ // find standard libraries that aren't in the toolchain, like libc++. Here we
216
+ // use xcrun to tell us what the default sdk root should be.
217
+ if newEnv["SDKROOT"] == nil {
218
+ newEnv["SDKROOT"] = (try? await self.runProgramOutput("/usr/bin/xcrun", "--show-sdk-path"))?.replacingOccurrences(of: "\n", with: "")
219
+ }
220
+#endif
221
+
222
try self.runProgram([commandToRun] + arguments, env: newEnv)
223
224
0 commit comments