#!/usr/bin/env bash # brintc++ — the C++ compiler driver for wasm32-hwjs-linux. # # Same front-door shape as brintcc (read that header for the libc selection and # why this execs), plus one thing: the C++ implementation compiles the C++ TUs # itself and DELEGATES the link to the C driver, so the two must be the same # libc arm. Naming that driver explicitly is deliberate — it used to be found # by name, and a PATH surprise could swap the substrate underneath a link. set -euo pipefail # readlink -f, not dirname alone: these front doors are meant to be symlinked # into a prefix on PATH, and a symlink's dirname is the prefix, not this repo. source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/../libexec/config.sh" brintium_require llvm sysroot brintium_select_libc "$@" case "$BRINTIUM_LIBC" in glibc) brintium_require kernel-headers export WASMCXX_CC_DRIVER="${WASMCXX_CC_DRIVER:-$BRINTIUM/libexec/brintcc-glibc}" exec "$BRINTIUM/libexec/brintc++-glibc" "${BRINTIUM_ARGV[@]}" ;; musl) export WASMCXX_CC_DRIVER="${WASMCXX_CC_DRIVER:-$BRINTIUM/libexec/brintcc-musl}" exec "$BRINTIUM/libexec/brintc++-musl" "${BRINTIUM_ARGV[@]}" ;; esac