Эх сурвалжийг харах

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

Lucas Fernandes Nogueira 3 жил өмнө
parent
commit
4bacea5bf4

+ 5 - 0
.changes/macos-deployment-target.md

@@ -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 - 0
core/tauri-build/src/lib.rs

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