about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/build.sh
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2022-06-06 22:04:37 -0400
committerAntoni Boucher <bouanto@zoho.com>2022-06-06 22:04:37 -0400
commit3fac982e07a859ffedba37865bcc6c508e47893b (patch)
treea12775cef836537f2c2dad6a3f32788285c5cdf2 /compiler/rustc_codegen_gcc/build.sh
parent50b00252aeb77b10db04d65dc9e12ce758def4b5 (diff)
parente8dca3e87d164d2806098c462c6ce41301341f68 (diff)
downloadrust-3fac982e07a859ffedba37865bcc6c508e47893b.tar.gz
rust-3fac982e07a859ffedba37865bcc6c508e47893b.zip
Merge commit 'e8dca3e87d164d2806098c462c6ce41301341f68' into sync_from_cg_gcc
Diffstat (limited to 'compiler/rustc_codegen_gcc/build.sh')
-rwxr-xr-xcompiler/rustc_codegen_gcc/build.sh25
1 files changed, 14 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_gcc/build.sh b/compiler/rustc_codegen_gcc/build.sh
index 230ab7b6d42..ba0d0d04948 100755
--- a/compiler/rustc_codegen_gcc/build.sh
+++ b/compiler/rustc_codegen_gcc/build.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #set -x
 set -e
@@ -6,6 +6,8 @@ set -e
 codegen_channel=debug
 sysroot_channel=debug
 
+flags=
+
 while [[ $# -gt 0 ]]; do
     case $1 in
         --release)
@@ -16,6 +18,15 @@ while [[ $# -gt 0 ]]; do
             sysroot_channel=release
             shift
             ;;
+        --no-default-features)
+            flags="$flags --no-default-features"
+            shift
+            ;;
+        --features)
+            shift
+            flags="$flags --features $1"
+            shift
+            ;;
         *)
             echo "Unknown option $1"
             exit 1
@@ -33,21 +44,13 @@ fi
 export LD_LIBRARY_PATH="$GCC_PATH"
 export LIBRARY_PATH="$GCC_PATH"
 
-features=
-
-if [[ "$1" == "--features" ]]; then
-    shift
-    features="--features $1"
-    shift
-fi
-
 if [[ "$codegen_channel" == "release" ]]; then
     export CHANNEL='release'
-    CARGO_INCREMENTAL=1 cargo rustc --release $features
+    CARGO_INCREMENTAL=1 cargo rustc --release $flags
 else
     echo $LD_LIBRARY_PATH
     export CHANNEL='debug'
-    cargo rustc $features
+    cargo rustc $flags
 fi
 
 source config.sh