You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: build.rs
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,21 @@ fn main() {
31
31
lean_dir.join("lib/lean")
32
32
};
33
33
34
-
if !cfg!(feature = "static"){
34
+
// To find libc++ on macOS, We must find the path to XCode, which apple enjoys
35
+
// changing each macOS release.
36
+
// Thus, we do this in a robust fashion by querying `xcrun`.
37
+
ifcfg!(target_os = "macos"){
38
+
let xcrun_output = Command::new("xcrun")
39
+
.args(["--show-sdk-path"])
40
+
.output()
41
+
.expect("failed to execute `xcrun --show-sdk-path`, which is used to find the location of MacOS platform libraries. Please ensure that XCode is installed.");
42
+
let libcpp_path = PathBuf::from(String::from_utf8(xcrun_output.stdout)
43
+
.expect("Path returned by `xcrun --show-sdk-path` is invalid UTF-8. This must never happen.").trim())
0 commit comments