blob: 7321781f458fd0f63d05e5237652b2a1dcbf3b02 [file] [log] [blame]
#!/usr/bin/env bash
set -xeuf -o pipefail
pushd "${0%/*}"
rm -rf build
# Mimic the LUCI environment defined in
# https://fuchsia.googlesource.com/infra/recipes/+/refs/heads/master/recipes/bloaty.py#59
export CC=`which clang`
export CXX=`which clang++`
# On LUCI, we should set the `RUST_TOOLCHAIN_PREFIX` variable.
# For local builds, cmake will try to detect its location automatically.
cmake . -DCMAKE_GENERATOR=Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-static-libstdc++ -ldl -lpthread' -Bbuild
ninja -C build
ninja -C build test
popd