blob: d1960bccad732c6c98b5aaae75d01fd22f062aca [file] [log] [blame]
#!/bin/bash
# Build Skia with one of Clang's many sanitizers.
#
# $ tools/xsan_build {address,thread,undefined,etc.} [any other flags to pass to make...]
#
# This script assumes the use of Clang >=3.2.
#
# For more information, see:
# http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
set -e
set -x
export CC=clang
export CXX=clang++
$CC --version
if [[ "$1" == "memory" ]]; then
export GYP_DEFINES="skia_gpu=0 skia_no_fontconfig=1 skia_freetype_static=1 ${GYP_DEFINES}"
fi
export GYP_DEFINES="skia_sanitizer=$1 ${GYP_DEFINES}"
shift
make $@