mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Work around Xcode 15 breaking older macOS versions
This commit is contained in:
parent
51a10f0969
commit
373a63f610
1 changed files with 11 additions and 0 deletions
|
@ -3,7 +3,9 @@
|
||||||
|
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
|
use anki_process::CommandExt;
|
||||||
use camino::Utf8Path;
|
use camino::Utf8Path;
|
||||||
|
use camino::Utf8PathBuf;
|
||||||
|
|
||||||
use super::artifacts::macos_deployment_target;
|
use super::artifacts::macos_deployment_target;
|
||||||
use crate::run::run_command;
|
use crate::run::run_command;
|
||||||
|
@ -37,5 +39,14 @@ pub fn build_bundle_binary() {
|
||||||
)
|
)
|
||||||
.env("MACOSX_DEPLOYMENT_TARGET", macos_deployment_target())
|
.env("MACOSX_DEPLOYMENT_TARGET", macos_deployment_target())
|
||||||
.env("CARGO_BUILD_TARGET", env!("TARGET"));
|
.env("CARGO_BUILD_TARGET", env!("TARGET"));
|
||||||
|
if env!("TARGET") == "x86_64-apple-darwin" {
|
||||||
|
let xcode_path = Command::run_with_output(["xcode-select", "-p"]).unwrap();
|
||||||
|
let ld_classic = Utf8PathBuf::from(xcode_path.stdout.trim())
|
||||||
|
.join("Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic");
|
||||||
|
if ld_classic.exists() {
|
||||||
|
// work around XCode 15's default linker not supporting macOS 10.15-12.
|
||||||
|
command.env("RUSTFLAGS", &format!("-Clink-arg=-fuse-ld={ld_classic}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
run_command(&mut command);
|
run_command(&mut command);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue