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 c219f4d commit 92515c9Copy full SHA for 92515c9
Sources/SwiftlyCore/Platform.swift
@@ -183,6 +183,15 @@ extension Platform {
183
newEnv[key] = value
184
}
185
186
+#if os(macOS)
187
+ // On macOS, we try to set SDKROOT if its empty for tools like clang++ that need it to
188
+ // find standard libraries that aren't in the toolchain, like libc++. Here we
189
+ // use xcrun to tell us what the default sdk root should be.
190
+ if newEnv["SDKROOT"] == nil {
191
+ newEnv["SDKROOT"] = (try? await self.runProgramOutput("/usr/bin/xcrun", "--show-sdk-path"))?.replacingOccurrences(of: "\n", with: "")
192
+ }
193
+#endif
194
+
195
try self.runProgram([commandToRun] + arguments, env: newEnv)
196
197
0 commit comments