Skip to content

Commit

Permalink
feat(core): set MACOSX_DEPLOYMENT_TARGET environment variable, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Feb 17, 2022
1 parent 17f17a8 commit 4bacea5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/macos-deployment-target.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-build": patch
---

Automatically emit `cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET` with the value set on `tauri.conf.json > tauri > bundle > macos > minimumSystemVersion`.
7 changes: 7 additions & 0 deletions core/tauri-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
copy_resources(ResourcePaths::new(paths.as_slice(), true), target_dir)?;
}

#[cfg(target_os = "macos")]
{
if let Some(version) = config.tauri.bundle.macos.minimum_system_version {
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={}", version);
}
}

#[cfg(windows)]
{
use anyhow::Context;
Expand Down

0 comments on commit 4bacea5

Please sign in to comment.