Skip to content

Commit

Permalink
fix: cross compilation from macOS (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Feb 15, 2022
1 parent 8fdaf9c commit c97499f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-cross-compile-macos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

Fix cross compilation from `macOS`.
11 changes: 6 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

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

#[cfg(target_os = "macos")]
fn main() {
println!("cargo:rustc-link-lib=framework=WebKit");
let is_macos = std::env::var("TARGET")
.map(|t| t.ends_with("-darwin"))
.unwrap_or_default();
if is_macos {
println!("cargo:rustc-link-lib=framework=WebKit");
}
}

0 comments on commit c97499f

Please sign in to comment.