summary history branches tags files
commit:08a92a0e643e942911799c9ee8becaae1b30d7e9
author:Trevor Bentley
committer:Trevor Bentley
date:Sun Jun 23 20:56:55 2019 +0200
parents:10e10acd11f5ce9bea0b0d32f670b61c0ff2955a
Add alternative search path for private frameworks
diff --git a/build.rs b/build.rs
line changes: +10/-3
index 430cd11..d82f7dc
--- a/build.rs
+++ b/build.rs
@@ -8,10 +8,17 @@ fn add_xcode_private_framework_path() {
         .expect("Failed to run xcode-select");
     let mut xcode_dir = String::from_utf8(xcode_dir.stdout).unwrap();
     xcode_dir.pop(); // remove trailing newline
-    let framework_dir = format!("{}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/PrivateFrameworks/",
-                                xcode_dir);
-    println!("XCode PrivateFramework dir: {}", framework_dir);
 
+    let private_framework_dirs = vec![
+        format!("{}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/PrivateFrameworks/",
+                xcode_dir),
+        "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/PrivateFrameworks/DFRFoundation.framework/".into(),
+    ];
+    let framework_dir = private_framework_dirs.iter().filter(|dir| {
+        std::path::Path::new(dir).is_dir()
+    }).next().expect("XCode PrivateFramework directory not found.");
+
+    println!("XCode PrivateFramework dir: {}", framework_dir);
     println!("cargo:rustc-link-search=framework={}", framework_dir);
 }