-
Notifications
You must be signed in to change notification settings - Fork 756
Cross compiling
Colm edited this page Feb 5, 2018
·
15 revisions
A cross compilation environment is provided as a docker image. Build the image from the root of the project with the following command :
$ docker build -t librespot-cross -f contrib/Dockerfile .
The resulting image can be used to build librespot for linux x86_64, armhf (compatible e. g. with Raspberry Pi 2 or 3, but not with Raspberry Pi 1 or Zero) and armel.
The compiled binaries will be located in /tmp/librespot-build/<architecture>/release/
docker run -v /tmp/librespot-build:/build librespot-cross
If only one architecture is desired, cargo can be invoked directly with the appropriate options :
docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --no-default-features --features alsa-backend
docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend
docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabi --no-default-features --features alsa-backendDon't forget to set the with-tremor feature flag if your target device does not have floating-point capabilities.