Explorar el Código

fix(cli): set MACOSX_DEPLOYMENT_TARGET env var, closes #4704 (#4842)

Lucas Fernandes Nogueira hace 3 años
padre
commit
fa23310f23

+ 6 - 0
.changes/macos-deployment-target-env-var.md

@@ -0,0 +1,6 @@
+---
+"cli.rs": patch
+"cli.js": patch
+---
+
+Set the `MACOSX_DEPLOYMENT_TARGET` environment variable with the configuration `minimum_system_version` value.

+ 5 - 0
tooling/cli/src/interface/rust.rs

@@ -141,6 +141,11 @@ impl Interface for Rust {
       }
       manifest
     };
+
+    if let Some(minimum_system_version) = &config.tauri.bundle.macos.minimum_system_version {
+      std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version);
+    }
+
     Ok(Self {
       app_settings: RustAppSettings::new(config, manifest)?,
       config_features: config.build.features.clone().unwrap_or_default(),