2013-10-08 15:16:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Build Skia with one of Clang's many sanitizers.
|
|
|
|
#
|
2014-04-24 18:16:13 +00:00
|
|
|
# $ tools/xsan_build {address,thread,undefined,etc.} [any other flags to pass to make...]
|
2013-10-08 15:16:36 +00:00
|
|
|
#
|
|
|
|
# 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
|
2016-02-03 17:21:44 +00:00
|
|
|
set -x
|
2013-10-08 15:16:36 +00:00
|
|
|
|
2016-02-03 17:21:44 +00:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
$CC --version
|
2013-10-08 15:16:36 +00:00
|
|
|
|
2016-02-03 17:21:44 +00:00
|
|
|
if [[ "$1" == "memory" ]]; then
|
|
|
|
export GYP_DEFINES="skia_gpu=0 skia_no_fontconfig=1 skia_freetype_static=1 ${GYP_DEFINES}"
|
2013-10-08 15:16:36 +00:00
|
|
|
fi
|
2016-02-03 17:21:44 +00:00
|
|
|
export GYP_DEFINES="skia_sanitizer=$1 ${GYP_DEFINES}"
|
2013-10-08 15:16:36 +00:00
|
|
|
|
2016-02-03 17:21:44 +00:00
|
|
|
shift
|
|
|
|
make $@
|