feat(core): set MACOSX_DEPLOYMENT_TARGET environment variable, closes #2732 (#3496)

This commit is contained in:
Lucas Fernandes Nogueira
2022-02-17 19:00:19 -03:00
committed by GitHub
parent 17f17a80f8
commit 4bacea5bf4
2 changed files with 12 additions and 0 deletions

View File

@@ -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`.

View File

@@ -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;