cc-wrapper: rename $needsTarget -> $targetPassed

in preparation for next commit
This commit is contained in:
Alba Mendez
2025-03-28 10:49:11 +01:00
committed by Alyssa Ross
parent 12f68bf117
commit 4ab72ac13e
@@ -1,4 +1,4 @@
needsTarget=true
targetPassed=false
targetValue=""
declare -i n=0
@@ -14,22 +14,22 @@ while (("$n" < "$nParams")); do
echo "Error: -target requires an argument" >&2
exit 1
fi
needsTarget=false
targetPassed=true
targetValue=$v
# skip parsing the value of -target
n+=1
;;
--target=*)
needsTarget=false
targetPassed=true
targetValue="${p#*=}"
;;
esac
done
if ! $needsTarget && [[ "$targetValue" != "@defaultTarget@" ]]; then
if $targetPassed && [[ "$targetValue" != "@defaultTarget@" ]]; then
echo "Warning: supplying the --target $targetValue != @defaultTarget@ argument to a nix-wrapped compiler may not work correctly - cc-wrapper is currently not designed with multi-target compilers in mind. You may want to use an un-wrapped compiler instead." >&2
fi
if $needsTarget && [[ $0 != *cpp ]]; then
if ! $targetPassed && [[ $0 != *cpp ]]; then
extraBefore+=(-target @defaultTarget@ @machineFlags@)
fi