From 0205e01b3c448ab66915b375a01d99d23113c679 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Fri, 13 Sep 2024 19:51:33 +0300 Subject: [PATCH] build: macos fix --- macos/build_release.sh | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/macos/build_release.sh b/macos/build_release.sh index da4722e..5f50d35 100755 --- a/macos/build_release.sh +++ b/macos/build_release.sh @@ -29,24 +29,12 @@ rustup target add aarch64-apple-darwin [[ $2 == "x86_64" ]] && arch+=(x86_64-apple-darwin) [[ $2 == "arm" ]] && arch+=(aarch64-apple-darwin) +[[ $2 == "universal" ]]; arch+=(universal2-apple-darwin) -if [[ "$OSTYPE" != "darwin"* ]]; then - rustup target add x86_64h-apple-darwin - [[ $2 == "universal" ]] && arch+=(x86_64h-apple-darwin) -else - [[ $2 == "universal" ]] && arch+=(universal2-apple-darwin) - rm -rf target/x86_64-apple-darwin - rm -rf target/aarch64-apple-darwin -fi - -# Start release build with zig linker on non-MacOS systems -if [[ "$OSTYPE" != "darwin"* ]]; then - cargo install cargo-zigbuild - cargo zigbuild --release --target ${arch} - rm -rf .intentionally-empty-file.o -else - cargo build --release --target ${arch} -fi +# Start release build with zig linker, requires zig 0.12.1 +cargo install cargo-zigbuild +cargo zigbuild --release --target ${arch} +rm -rf .intentionally-empty-file.o yes | cp -rf target/${arch}/release/grim macos/Grim.app/Contents/MacOS