Skip to content

Commit ea81314

Browse files
Document how to create a fat binary for Mac x86_64 and Apple Silicon (#1636)
* Document how to create a fat binary for Mac x86_64 and Apple Silicon * Remove the hint about the macOS SDK needed. It's no longer needed.
1 parent c5e192c commit ea81314

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

COMPILING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,29 @@ Or to use rustls-tls with ALSA:
180180
cargo build --no-default-features --features "rustls-tls alsa-backend with-libmdns"
181181
```
182182

183+
### Compiling on Apple Silicon (M1+) for Apple x86_64
184+
185+
Install the additional `x86_64-apple-darwin` target using rustup:
186+
187+
```bash
188+
rustup target install x86_64-apple-darwin
189+
```
190+
191+
Then run the build with the additional target parameter:
192+
193+
```bash
194+
cargo build --target=x86_64-apple-darwin --release
195+
```
196+
197+
You can then use the `lipo` tool to create a single fat (universal) binary for both platforms:
198+
199+
```bash
200+
lipo -create \
201+
-arch x86_64 target/x86_64-apple-darwin/release/librespot \
202+
-arch arm64 target/aarch64-apple-darwin/release/librespot \
203+
-output librespot
204+
```
205+
183206
### Running
184207

185208
Assuming you just compiled a ```debug``` build, you can run librespot with the following command:

0 commit comments

Comments
 (0)