From 098e6450c16b5694edbdc8df3c4d594e4aa9482b Mon Sep 17 00:00:00 2001 From: Jason Dagit Date: Mon, 30 Sep 2024 01:43:04 -0700 Subject: [PATCH] try harder to support os11 --- .github/workflows/onpush.yml | 18 +++++++++++++----- Cargo.toml | 8 +++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/onpush.yml b/.github/workflows/onpush.yml index 2dbeb31..547aea7 100644 --- a/.github/workflows/onpush.yml +++ b/.github/workflows/onpush.yml @@ -183,11 +183,6 @@ jobs: wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O appimagetool chmod a+x appimagetool - - name: Install dependencies (macOS) - if: ${{ matrix.is-osx }} - run: | - brew install wget - - name: Install Rust targets (macOS) if: ${{ matrix.is-osx }} run: | @@ -217,15 +212,27 @@ jobs: restore-keys: | ${{ runner.os }}-target-build-${{ matrix.target }}- + - name: Set MACOSX_DEPLOYMENT_TARGET (macOS) + if: ${{ matrix.is-osx }} + run: echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV + + - name: Set CFLAGS and LDFLAGS for Native Code + if: ${{ matrix.is-osx }} + run: | + echo "CFLAGS=-mmacosx-version-min=11.0" >> $GITHUB_ENV + echo "LDFLAGS=-mmacosx-version-min=11.0" >> $GITHUB_ENV + - name: Build for x86_64-apple-darwin (macOS) if: ${{ matrix.is-osx }} run: | cargo build --release --target x86_64-apple-darwin + otool -l target/x86_64-apple-darwin/release/annelid | grep -A 3 LC_VERSION_MIN_MACOSX - name: Build for aarch64-apple-darwin (macOS) if: ${{ matrix.is-osx }} run: | cargo build --release --target aarch64-apple-darwin + otool -l target/aarch64-apple-darwin/release/annelid | grep -A 3 LC_VERSION_MIN_MACOSX - name: Create universal binary (macOS) if: ${{ matrix.is-osx }} @@ -248,6 +255,7 @@ jobs: chmod +x Annelid.app/Contents/MacOS/annelid cp Info.plist Annelid.app/Contents/ codesign --deep --force --sign - Annelid.app + lipo -info Annelid.app/Contents/MacOS/annelid zip -r ./target/release/Annelid.zip Annelid.app - name: Linux bundling diff --git a/Cargo.toml b/Cargo.toml index 0806500..7f5aacb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,9 +58,11 @@ long_description = """ A speedrun timer with autosplitter capabilities for USB2SNES. """ -[target.'cfg(target_os = "macos")'.rustflags] -linker-flavor = "ld" -link-args = ["-mmacosx-version-min=11.0"] +[target.x86_64-apple-darwin] +rustflags = ["-C", "link-args=-mmacosx-version-min=11.0"] + +[target.aarch64-apple-darwin] +rustflags = ["-C", "link-args=-mmacosx-version-min=11.0"] [package.metadata.appimage] auto_link = true