From 4ab72ac13e1a9952d686a6cb080a123e9506b7ac Mon Sep 17 00:00:00 2001 From: Alba Mendez Date: Thu, 27 Mar 2025 17:38:42 +0100 Subject: [PATCH] cc-wrapper: rename $needsTarget -> $targetPassed in preparation for next commit --- .../cc-wrapper/add-clang-cc-cflags-before.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/add-clang-cc-cflags-before.sh b/pkgs/build-support/cc-wrapper/add-clang-cc-cflags-before.sh index 039263e9aaca..029e5e6ae29c 100644 --- a/pkgs/build-support/cc-wrapper/add-clang-cc-cflags-before.sh +++ b/pkgs/build-support/cc-wrapper/add-clang-cc-cflags-before.sh @@ -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