File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33SCRIPT_DIR=" $( dirname " ${BASH_SOURCE[0]} " ) "
4- BUILDROOT_ABS=" $( realpath " $SCRIPT_DIR /../../../buildroot/include" 2> /dev/null || true) "
4+ BUILDROOT_INC=" ${BUILD_INCLUDE_PATH:- $SCRIPT_DIR / ../ ../ ../ buildroot/ include} "
5+ BUILDROOT_ABS=" $( realpath " $BUILDROOT_INC " 2> /dev/null || true) "
56PARSED_ARGS=()
67
8+ is_buildroot_inc () {
9+ [[ -n " $BUILDROOT_ABS " && " $1 " == " $BUILDROOT_ABS " ]]
10+ }
11+
712while [[ $# -gt 0 ]]; do
813 case " $1 " in
914 -isystem)
1015 shift
1116 ARG=" $1 "
1217 shift
1318 ARG_ABS=" $( realpath " $ARG " 2> /dev/null || true) "
14- [[ " $ARG_ABS " == " $BUILDROOT_ABS " ]] && PARSED_ARGS+=(" -I$ARG " ) || PARSED_ARGS+=(" -isystem" " $ARG " )
19+ is_buildroot_inc " $ARG_ABS " && PARSED_ARGS+=(" -I$ARG " ) || PARSED_ARGS+=(" -isystem" " $ARG " )
1520 ;;
1621 -isystem* )
1722 ARG=" ${1# -isystem} "
1823 shift
1924 ARG_ABS=" $( realpath " $ARG " 2> /dev/null || true) "
20- [[ " $ARG_ABS " == " $BUILDROOT_ABS " ]] && PARSED_ARGS+=(" -I$ARG " ) || PARSED_ARGS+=(" -isystem$ARG " )
25+ is_buildroot_inc " $ARG_ABS " && PARSED_ARGS+=(" -I$ARG " ) || PARSED_ARGS+=(" -isystem$ARG " )
2126 ;;
2227 -march=* |-mcpu=* )
2328 OPT_NAME=" ${1%% =* } "
@@ -32,6 +37,10 @@ while [[ $# -gt 0 ]]; do
3237 PARSED_ARGS+=(" ${OPT_NAME} =${OPT_VALUE} " )
3338 shift
3439 ;;
40+ -Wlogical-op|-Wduplicated-cond|-Wduplicated-branches|-Wno-clobbered|-Wjump-misses-init|-Wformat-truncation|-Warray-bounds=* |-Wimplicit-fallthrough=* )
41+ # GCC-only warning flags that clang/zig doesn't recognize; drop to silence -Wunknown-warning-option noise
42+ shift
43+ ;;
3544 * )
3645 PARSED_ARGS+=(" $1 " )
3746 shift
You can’t perform that action at this time.
0 commit comments