Skip to content

Commit

Permalink
try harder to support os11
Browse files Browse the repository at this point in the history
  • Loading branch information
dagit committed Sep 30, 2024
1 parent b506767 commit 098e645
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/onpush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 098e645

Please sign in to comment.