mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2015 Google Inc. |
| 3 | # |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | # Script for building with CMake on Skia build bots. |
| 8 | # If you have CMake installed on your system, you can just use it normally. |
| 9 | |
| 10 | set -e |
| 11 | set -x |
| 12 | |
mtklein | 0faed58 | 2015-09-14 12:02:32 -0700 | [diff] [blame^] | 13 | fulldir() { |
| 14 | cd `dirname $1` |
| 15 | echo `pwd` |
| 16 | } |
| 17 | |
| 18 | here=`fulldir $0` |
mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 19 | cores=32 |
| 20 | |
mtklein | 0faed58 | 2015-09-14 12:02:32 -0700 | [diff] [blame^] | 21 | if [[ -z "$BUILDTYPE" || -z "$SKIA_OUT" ]]; then |
| 22 | echo "If you're a bot, you should be setting BUILDTYPE ($BUILDTYPE) and SKIA_OUT ($SKIA_OUT)." |
| 23 | echo "If you're not a bot, you don't want to run this script." |
| 24 | exit 1 |
| 25 | fi |
| 26 | |
mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 27 | echo "Bootstrapping CMake" |
| 28 | pushd $here/../third_party/externals/cmake |
| 29 | ./bootstrap --parallel=$cores |
| 30 | make -j $cores |
| 31 | popd |
| 32 | |
| 33 | echo "Building with bootstrapped CMake" |
mtklein | 0faed58 | 2015-09-14 12:02:32 -0700 | [diff] [blame^] | 34 | mkdir -p $SKIA_OUT |
| 35 | pushd $SKIA_OUT |
| 36 | $here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE $here -G Ninja |
mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 37 | ninja skia # The default also builds `example`, which I'm leaving a TODO for now. |
| 38 | popd |