Skip to content

Commit

Permalink
[rs] BUILD_ROOT environment var to minimise pollution in the source repo
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Apr 8, 2024
1 parent 0c1a821 commit 1cc533a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion rs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
set -eu

cd $(dirname $0)
BUILDDIR=${BUILD_ROOT:-target}/$(basename $(pwd))-$(echo $(basename $0) | sed 's/build_*\(.*\).sh/\1/')-$(uname)-$(uname -m)
export CARGO_TARGET_DIR=$BUILDDIR
cargo build --release
cp ./target/release/rosettaboy-rs ./rosettaboy-release
cp $BUILDDIR/release/rosettaboy-rs ./rosettaboy-release
2 changes: 1 addition & 1 deletion rs/build_cranelift_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ cd $(dirname $0)
BUILDDIR=${BUILD_ROOT:-target}/$(basename $(pwd))-cranelift-$(echo $(basename $0) | sed 's/build_*\(.*\).sh/\1/')-$(uname)-$(uname -m)
export CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift
export CARGO_TARGET_DIR=$BUILDDIR
cargo +nightly build -Zcodegen-backend --release
cargo +nightly build -Zcodegen-backend
cp $BUILDDIR/debug/rosettaboy-rs ./rosettaboy-cranelift
4 changes: 3 additions & 1 deletion rs/build_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
set -eu

cd $(dirname $0)
BUILDDIR=${BUILD_ROOT:-target}/$(basename $(pwd))-$(echo $(basename $0) | sed 's/build_*\(.*\).sh/\1/')-$(uname)-$(uname -m)
export CARGO_TARGET_DIR=$BUILDDIR
cargo build
cp ./target/debug/rosettaboy-rs ./rosettaboy-debug
cp $BUILDDIR/debug/rosettaboy-rs ./rosettaboy-debug
4 changes: 3 additions & 1 deletion rs/build_lto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
set -eu

cd $(dirname $0)
BUILDDIR=${BUILD_ROOT:-target}/$(basename $(pwd))-$(echo $(basename $0) | sed 's/build_*\(.*\).sh/\1/')-$(uname)-$(uname -m)
export CARGO_TARGET_DIR=$BUILDDIR
cargo build --profile release-lto
cp ./target/release-lto/rosettaboy-rs ./rosettaboy-lto
cp $BUILDDIR/release-lto/rosettaboy-rs ./rosettaboy-lto

0 comments on commit 1cc533a

Please sign in to comment.