Skip to content

Instantly share code, notes, and snippets.

@pietro
Created May 17, 2016 16:22
Show Gist options
  • Save pietro/29ff75461465b9c7a5f961006456a121 to your computer and use it in GitHub Desktop.
Save pietro/29ff75461465b9c7a5f961006456a121 to your computer and use it in GitHub Desktop.
Ring build script
#!/bin/bash
set -eux -o pipefail
IFS=$'\n\t'
$CC_X --version
$CXX_X --version
make --version
cargo version
rustc --version
mkdir -p .cargo
echo "[target.$TARGET_X]" > .cargo/config
echo "linker= \"$CC_X\"" >> .cargo/config
cat .cargo/config
build_dir="target/${TARGET_X}"
if [[ "${MODE_X-}" == "RELWITHDEBINFO" ]]; then
build_dir="${build_dir}/release"
mode=--release;
else
build_dir="${build_dir}/debug"
fi
CC=$CC_X CXX=$CXX_X cargo build -j2 ${mode-} --verbose --target=$TARGET_X
CC=$CC_X CXX=$CXX_X cargo test -j2 ${mode-} --no-run --verbose --target=$TARGET_X
echo "Ring built at: ${build_dir}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment