cc-wrapper: heed `NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING` (#396373)

authored by jade and committed by GitHub 31640d5f 76c04c0e

+1 -1
+1 -1
pkgs/build-support/cc-wrapper/add-clang-cc-cflags-before.sh
··· 26 26 esac 27 27 done 28 28 29 - if $targetPassed && [[ "$targetValue" != "@defaultTarget@" ]]; then 29 + if $targetPassed && [[ "$targetValue" != "@defaultTarget@" ]] && (( "${NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING:-0}" < 1 )); then 30 30 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 31 31 elif [[ $0 != *cpp ]]; then 32 32 extraBefore+=(-target @defaultTarget@ @machineFlags@)