[+] OSXCross rust build

This commit is contained in:
Azalea Gui 2024-12-22 04:47:16 -05:00
parent ca74acbafb
commit 90d12d9385
3 changed files with 44 additions and 3 deletions

21
tools/rust-builder/osx/build.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e
# Add cargo to path
export PATH="$HOME/.cargo/bin:$PATH"
cd /app
# OSX linker and ar
export OSX_VER=20.4
export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=/osxcross/bin/x86_64-apple-darwin$OSX_VER-clang
export CARGO_TARGET_X86_64_APPLE_DARWIN_AR=/osxcross/bin/x86_64-apple-darwin$OSX_VER-ar
export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=/osxcross/bin/aarch64-apple-darwin$OSX_VER-clang
export CARGO_TARGET_AARCH64_APPLE_DARWIN_AR=/osxcross/bin/aarch64-apple-darwin$OSX_VER-ar
# Build for platforms
#cp /osxcross/bin/x86_64-apple-darwin$OSX_VER-strip /usr/bin/strip
cargo build --release --target x86_64-apple-darwin
#cp /osxcross/bin/aarch64-apple-darwin$OSX_VER-strip /usr/bin/strip
cargo build --release --target aarch64-apple-darwin