Skip to content

Commit

Permalink
Merge pull request #131 from tactile-eng/fix-cross-compilation
Browse files Browse the repository at this point in the history
Fix cross compilation on a macos host
  • Loading branch information
l1npengtul authored Oct 17, 2023
2 parents 8ed702e + 411e243 commit 219ede9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions nokhwa-bindings-macos/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
* limitations under the License.
*/

#[cfg(any(target_os = "macos", target_os = "ios"))]
fn main() {
println!("cargo:rustc-link-lib=framework=CoreMedia");
println!("cargo:rustc-link-lib=framework=AVFoundation");
println!("cargo:rustc-link-lib=framework=CoreVideo");
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
if target_os == "macos" || target_os == "ios" {
println!("cargo:rustc-link-lib=framework=CoreMedia");
println!("cargo:rustc-link-lib=framework=AVFoundation");
println!("cargo:rustc-link-lib=framework=CoreVideo");
}
}

#[cfg(not(any(target_os = "macos", target_os = "ios")))]
fn main() {}

0 comments on commit 219ede9

Please sign in to comment.