2 sep
='--' # whether to add -- before new options
3 cxx
=0 # whether cxx was explicitly requested
4 lastWasx
=0 # whether the last argument passed was -x
6 if [[ "$e" == "--" ]]; then
9 if [[ "$sep" == "" ]]; then
10 # we look for -x c++ after -- only
11 if [[ "$e" == "-x" ]]; then
14 if [[ $lastWasx -eq 1 && "$e" == "c++" ]]; then
18 if [[ "$e" == "-xc++" ||
"$e" == -std=c
++* ]]; then
24 if [[ $cxx -eq 1 ]]; then
25 cxxflags
="@cxxincludes@"
27 if [[ -n "$NIX_DEBUG" ]]; then
30 export LIBCLANG_PATH
="@libclang@/lib"
31 # shellcheck disable=SC2086
32 # cxxflags and NIX_CFLAGS_COMPILE should be word-split
33 exec -a "$0" @unwrapped@
/bin
/bindgen
"$@" $sep $cxxflags @cincludes@
$NIX_CFLAGS_COMPILE
34 # note that we add the flags after $@ which is incorrect. This is only for the sake