Preprocess arguments to rustc to workaround cargo
This commit is contained in:
parent
c885d11337
commit
dcd96e2b94
1 changed files with 40 additions and 15 deletions
21
rustc.sh
21
rustc.sh
|
|
@ -1,2 +1,21 @@
|
|||
#!/bin/bash
|
||||
RUST_BACKTRACE=1 rustc -L build/userspace $*
|
||||
have_o=false
|
||||
for arg in "$@"; do
|
||||
if [[ "$arg" = "-o" ]]; then
|
||||
have_o=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
args=()
|
||||
for arg in "$@"; do
|
||||
if [[ $have_o = true && "$arg" =~ ^extra-filename= ]]; then
|
||||
unset args[${#args[@]}-1]
|
||||
elif [[ $have_o = true && "$arg" =~ ^--emit= ]]; then
|
||||
args+=("--emit=link")
|
||||
else
|
||||
args+=("$arg")
|
||||
fi
|
||||
done
|
||||
|
||||
RUST_BACKTRACE=1 exec rustc -L build/userspace "${args[@]}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue