OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 # Copyright 2015 Google Inc. | 2 # Copyright 2015 Google Inc. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Script for building with CMake on Skia build bots. | 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. | 8 # If you have CMake installed on your system, you can just use it normally. |
9 | 9 |
10 set -e | 10 set -e |
11 set -x | 11 set -x |
12 | 12 |
13 here=`dirname $0` | 13 fulldir() { |
| 14 cd `dirname $1` |
| 15 echo `pwd` |
| 16 } |
| 17 |
| 18 here=`fulldir $0` |
14 cores=32 | 19 cores=32 |
15 | 20 |
| 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 |
16 echo "Bootstrapping CMake" | 27 echo "Bootstrapping CMake" |
17 pushd $here/../third_party/externals/cmake | 28 pushd $here/../third_party/externals/cmake |
18 ./bootstrap --parallel=$cores | 29 ./bootstrap --parallel=$cores |
19 make -j $cores | 30 make -j $cores |
20 popd | 31 popd |
21 | 32 |
22 echo "Building with bootstrapped CMake" | 33 echo "Building with bootstrapped CMake" |
23 pushd $here | 34 mkdir -p $SKIA_OUT |
24 ../third_party/externals/cmake/bin/cmake . -G Ninja | 35 pushd $SKIA_OUT |
| 36 $here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE $he
re -G Ninja |
25 ninja skia # The default also builds `example`, which I'm leaving a TODO for no
w. | 37 ninja skia # The default also builds `example`, which I'm leaving a TODO for no
w. |
26 popd | 38 popd |
OLD | NEW |