Skip to content

Commit 97868a0

Browse files
committed
Target-dependent config
1 parent 3fe9ac3 commit 97868a0

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

.cargo/config.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1+
[target.'cfg(target_arch="x86_64")']
2+
rustflags = ["-C", "target-cpu=x86-64-v3"]
3+
4+
[target.'cfg(all(target_arch="aarch64", target_os="macos"))']
5+
rustflags = ["-C", "target-cpu=apple-a14"]
6+
7+
[target.'cfg(all(target_arch="aarch64", not(target_os="macos")))']
8+
rustflags = ["-C", "target-cpu=generic"]
9+
110
[build]
2-
rustflags = ["-C", "target-cpu=native"]
11+
# Fallback
12+
rustflags = ["-C", "target-cpu=native"]

.github/workflows/test.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,5 @@ jobs:
2626
~/.cargo/git
2727
target
2828
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
29-
- name: Override target-cpu on macOS
30-
if: runner.os == 'macOS'
31-
run: |
32-
mkdir -p .cargo
33-
cat > .cargo/config.toml << 'EOF'
34-
[build]
35-
rustflags = ["-C", "target-cpu=apple-m1"]
36-
EOF
3729
- name: Run tests
3830
run: cargo test --verbose

0 commit comments

Comments
 (0)