-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzcc
More file actions
34 lines (27 loc) · 710 Bytes
/
zcc
File metadata and controls
34 lines (27 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# zcc - Zig CC wrapper that filters out unsupported macOS linker flags
args=("$@")
filtered_args=()
skip_next=0
for arg in "${args[@]}"; do
if [ "$skip_next" -eq 1 ]; then
skip_next=0
continue
fi
# Handle -Wl,-exported_symbols_list,/path (single arg)
if [[ "$arg" == *"-exported_symbols_list,"* ]]; then
continue
fi
# Handle -Wl,-exported_symbols_list (skip next arg)
if [[ "$arg" == "-Wl,-exported_symbols_list" ]]; then
skip_next=1
continue
fi
# Handle -exported_symbols_list (skip next arg)
if [[ "$arg" == "-exported_symbols_list" ]]; then
skip_next=1
continue
fi
filtered_args+=("$arg")
done
exec zig cc "${filtered_args[@]}"