Merge pull request #143 from yvt/sysroot-profile

Add `--release-sysroot` flag to `build.sh`
This commit is contained in:
antoyo 2022-03-23 12:11:28 -04:00 committed by GitHub
commit a22e15b954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,26 @@
#set -x
set -e
codegen_channel=debug
sysroot_channel=debug
while [[ $# -gt 0 ]]; do
case $1 in
--release)
codegen_channel=release
shift
;;
--release-sysroot)
sysroot_channel=release
shift
;;
*)
echo "Unknown option $1"
exit 1
;;
esac
done
if [ -f ./gcc_path ]; then
export GCC_PATH=$(cat gcc_path)
else
@ -21,7 +41,7 @@ if [[ "$1" == "--features" ]]; then
shift
fi
if [[ "$1" == "--release" ]]; then
if [[ "$codegen_channel" == "release" ]]; then
export CHANNEL='release'
CARGO_INCREMENTAL=1 cargo rustc --release $features
else
@ -36,4 +56,9 @@ rm -r target/out || true
mkdir -p target/out/gccjit
echo "[BUILD] sysroot"
time ./build_sysroot/build_sysroot.sh $CHANNEL
if [[ "$sysroot_channel" == "release" ]]; then
time ./build_sysroot/build_sysroot.sh --release
else
time ./build_sysroot/build_sysroot.sh
fi