blob: d1960bccad732c6c98b5aaae75d01fd22f062aca [file] [log] [blame]
mtklein@google.com9f3b0e42013-10-08 15:16:36 +00001#!/bin/bash
2
3# Build Skia with one of Clang's many sanitizers.
4#
commit-bot@chromium.org7eb529f2014-04-24 18:16:13 +00005# $ tools/xsan_build {address,thread,undefined,etc.} [any other flags to pass to make...]
mtklein@google.com9f3b0e42013-10-08 15:16:36 +00006#
7# This script assumes the use of Clang >=3.2.
8#
9# For more information, see:
10# http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
11
12set -e
mtklein8ca88e42016-02-03 09:21:44 -080013set -x
mtklein@google.com9f3b0e42013-10-08 15:16:36 +000014
mtklein8ca88e42016-02-03 09:21:44 -080015export CC=clang
16export CXX=clang++
commit-bot@chromium.org7eb529f2014-04-24 18:16:13 +000017$CC --version
mtklein@google.com9f3b0e42013-10-08 15:16:36 +000018
mtklein8ca88e42016-02-03 09:21:44 -080019if [[ "$1" == "memory" ]]; then
20 export GYP_DEFINES="skia_gpu=0 skia_no_fontconfig=1 skia_freetype_static=1 ${GYP_DEFINES}"
21fi
22export GYP_DEFINES="skia_sanitizer=$1 ${GYP_DEFINES}"
23
24shift
25make $@