Mike Klein | 5d2be0d | 2015-09-15 08:29:02 -0400 | [diff] [blame] | 1 | #!/bin/bash |
mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 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 | de5973b | 2015-09-15 10:17:08 -0700 | [diff] [blame] | 13 | here=$(cd `dirname $0`; echo `pwd`) |
mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 14 | cores=32 |
| 15 | |
mtklein | 0faed58 | 2015-09-14 12:02:32 -0700 | [diff] [blame] | 16 | if [[ -z "$BUILDTYPE" || -z "$SKIA_OUT" ]]; then |
| 17 | echo "If you're a bot, you should be setting BUILDTYPE ($BUILDTYPE) and SKIA_OUT ($SKIA_OUT)." |
| 18 | echo "If you're not a bot, you don't want to run this script." |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 22 | echo "Bootstrapping CMake" |
| 23 | pushd $here/../third_party/externals/cmake |
| 24 | ./bootstrap --parallel=$cores |
mtklein | de5973b | 2015-09-15 10:17:08 -0700 | [diff] [blame] | 25 | make -j $cores cmake |
mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 26 | popd |
| 27 | |
mtklein | 7dd4467 | 2016-05-24 09:44:05 -0700 | [diff] [blame] | 28 | echo "Building static library with bootstrapped CMake" |
rmistry | 5d36360 | 2016-04-25 06:29:21 -0700 | [diff] [blame] | 29 | mkdir -p $SKIA_OUT/$BUILDTYPE |
| 30 | pushd $SKIA_OUT/$BUILDTYPE |
mtklein | 7dd4467 | 2016-05-24 09:44:05 -0700 | [diff] [blame] | 31 | $here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE \ |
| 32 | $here -G Ninja |
| 33 | ninja |
| 34 | popd |
| 35 | |
| 36 | echo "Building shared library with bootstrapped CMake" |
| 37 | mkdir -p $SKIA_OUT/$BUILDTYPE |
| 38 | pushd $SKIA_OUT/$BUILDTYPE |
| 39 | $here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=1 \ |
| 40 | $here -G Ninja |
mtklein | 935121b | 2015-09-15 06:07:47 -0700 | [diff] [blame] | 41 | ninja |
mtklein | a22eabe | 2015-09-14 10:02:50 -0700 | [diff] [blame] | 42 | popd |