-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into spi-transactions
- Loading branch information
Showing
16 changed files
with
2,140 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
|
||
[target.armv7-unknown-linux-gnueabihf] | ||
linker = "arm-linux-gnueabihf-gcc" | ||
|
||
# For some reason this _doesn't_ work here, but does for windows? | ||
#[target.armv7-unknown-linux-gnueabihf."usb-1.0"] | ||
#rustc-link-search = ["./cross/armhf/"] | ||
#rustc-link-lib = ["libusb-1.0"] | ||
|
||
[target.i686-pc-windows-gnu] | ||
linker = "i686-w64-mingw32-gcc-posix" | ||
ar = "i686-w64-mingw32-gcc-ar-posix" | ||
rustflags = "-C panic=abort" | ||
|
||
[target.i686-pc-windows-gnu."usb-1.0"] | ||
rustc-link-search = ["./cross/win/MinGW32/dll"] | ||
rustc-link-lib = ["libusb-1.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
RUSTC_WRAPPER="sccache" | ||
|
||
if [ -z "$SCCACHE_DIR"]; then | ||
export SCCACHE_DIR=$HOME/.cache | ||
fi | ||
|
||
if [ -z "$CARGO_HOME"]; then | ||
export CARGO_HOME=$HOME/.cargo | ||
fi | ||
|
||
|
||
DOCKER_CMD="docker run --rm -v=`pwd`:/work -v$CARGO_HOME/registry:/root/.cargo/registry -v$SCCACHE_DIR:/root/.cache --workdir=/work --user=:`id -g` --env PKG_CONFIG_ALLOW_CROSS=1" | ||
|
||
DOCKER_IMG=ryankurte/rust-embedded | ||
|
||
|
||
|
||
echo "Building for target: $1 (cargo cache: $CARGO_HOME, sccache $SCCACHE_DIR)" | ||
|
||
# Args for cross build for armhf, windows tricks are in .cargo/config | ||
ARMHF_ARGS="--env SYSROOT=/usr/arm-linux-gnueabihf --env PKG_CONFIG_ALLOW_CROSS=1 --env PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig --env PKG_CONFIG_SYSROOT_DIR=/usr/arm-linux-gnueabihf --env PKG_CONFIG_SYSTEM_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf --env PKG_CONFIG_SYSTEM_INCLUDE_PATH=/usr/arm-linux-gnueabihf/include" | ||
|
||
|
||
if [ "$1" == "x86_64-unknown-linux-gnu" ]; then | ||
$DOCKER_CMD $DOCKER_IMG /bin/bash -c "cargo build --target=$1 --release --features embedded-spi/hal-linux" | ||
|
||
elif [ "$1" == "armv7-unknown-linux-gnueabihf" ]; then | ||
$DOCKER_CMD $ARMHF_ARGS $DOCKER_IMG /bin/bash -c "cargo build --target=$1 --release --features embedded-spi/hal-linux" | ||
|
||
elif [ "$1" == "x86_64-apple-darwin" ]; then | ||
cargo build --target=$1 --release | ||
|
||
elif [ "$1" == "i686-pc-windows-gnu" ]; then | ||
$DOCKER_CMD $DOCKER_IMG /bin/bash -c "cargo build --target=$1 --release" | ||
|
||
else | ||
|
||
echo "Unsupported target: $1" | ||
exit 1 | ||
|
||
fi |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.