| Lift freeq's AV media plane out of sleek 90f8b89 nandi 19d ago | 1 | #!/bin/sh |
| 2 | # Compile C++ with zig's bundled glibc sysroot; no system C toolchain |
| 3 | # needed. Same arrangement as vidya's, with one addition it did not need. |
| 4 | # |
| 5 | # `cc-rs` builds a `--target=` from the Rust triple, which carries a vendor |
| 6 | # field: `x86_64-unknown-linux-gnu`. zig's own triples have no vendor, and it |
| 7 | # refuses the whole query rather than ignoring the part it does not want — |
| 8 | # "unable to parse target query: UnknownOperatingSystem", which reads as though |
| 9 | # Linux were the problem. aws-lc-sys compiles C, so this is the difference |
| 10 | # between a workspace that builds and one that does not. |
| 11 | # |
| 12 | # Drop the vendor on the way past. Nothing else is touched. |
| 13 | for arg do |
| 14 | case "$arg" in |
| 15 | --target=*-unknown-linux-*) |
| 16 | arg="--target=$(echo "${arg#--target=}" | sed 's/-unknown-linux-/-linux-/')" |
| 17 | ;; |
| 18 | esac |
| 19 | set -- "$@" "$arg" |
| 20 | shift |
| 21 | done |
| 22 | exec "$(dirname "$0")/zig" c++ "$@" |