diff --git a/scripts/build.sh b/scripts/build.sh index e96514f11..4ce2c7b06 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,6 +1,14 @@ #!/usr/bin/env bash set -e +# Target triple of the host machine. Set to x86-64 Linux by default, as that's +# the correct value for the CI server. +# +# Unfotunately there doesn't seem to be a way to tell Cargo to just use the +# target of the host machine, and since we override the default target in +# `.cargo/config` for convenience, this variable is required. +HOST_TARGET=${HOST_TARGET:-x86_64-unknown-linux-gnu} + # Fail build, if there are any warnings. export RUSTFLAGS="-D warnings" @@ -10,6 +18,7 @@ if [ "$TRAVIS_RUST_VERSION" != beta ] && [ "$TRAVIS_RUST_VERSION" != nightly ]; fi function build() { + cargo test --verbose --features=$1,no-target-warning --target=$HOST_TARGET cargo build --verbose --features=$1-rt,no-target-warning --examples }