borenet | 11271fe | 2015-07-06 07:43:58 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | # Build Skia for use with LLVM's coverage tools. |
| 7 | # |
| 8 | # $ tools/llvm_coverage_build [any other flags to pass to make...] |
| 9 | # |
borenet | 5150a77 | 2015-07-17 07:31:07 -0700 | [diff] [blame] | 10 | # This script assumes the use of Clang 3.6. Earlier versions do not support |
| 11 | # the flags we use in the build, and 3.7+ hit asserts during compilation. |
borenet | 11271fe | 2015-07-06 07:43:58 -0700 | [diff] [blame] | 12 | # |
| 13 | set -e |
| 14 | |
borenet | 5150a77 | 2015-07-17 07:31:07 -0700 | [diff] [blame] | 15 | export CC="${CC:-$(which clang)}" |
| 16 | export CXX="${CXX:-$(which clang++)}" |
borenet | 11271fe | 2015-07-06 07:43:58 -0700 | [diff] [blame] | 17 | |
| 18 | if [[ -z "${CC}" ]] || [[ -z "${CXX}" ]]; then |
| 19 | echo "Couldn't find Clang on this machine!" |
| 20 | exit 1 |
| 21 | fi |
| 22 | |
| 23 | echo "CC=$CC" |
| 24 | echo "CXX=$CXX" |
| 25 | $CC --version |
| 26 | |
mtklein | f059900 | 2015-07-13 06:18:39 -0700 | [diff] [blame] | 27 | export GYP_DEFINES="skia_clang_build=1" |
borenet | 11271fe | 2015-07-06 07:43:58 -0700 | [diff] [blame] | 28 | export BUILDTYPE=Coverage |
| 29 | make $@ |