blob: 72785199f8503dbefc2a59a2680b03b53c32fd1e [file] [log] [blame]
Mike Klein5d2be0d2015-09-15 08:29:02 -04001#!/bin/bash
mtkleina22eabe2015-09-14 10:02:50 -07002# 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
10set -e
11set -x
12
mtklein0faed582015-09-14 12:02:32 -070013fulldir() {
14 cd `dirname $1`
15 echo `pwd`
16}
17
18here=`fulldir $0`
mtkleina22eabe2015-09-14 10:02:50 -070019cores=32
20
mtklein0faed582015-09-14 12:02:32 -070021if [[ -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
25fi
26
mtkleina22eabe2015-09-14 10:02:50 -070027echo "Bootstrapping CMake"
28pushd $here/../third_party/externals/cmake
29./bootstrap --parallel=$cores
30make -j $cores
31popd
32
33echo "Building with bootstrapped CMake"
mtklein0faed582015-09-14 12:02:32 -070034mkdir -p $SKIA_OUT
35pushd $SKIA_OUT
36$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE $here -G Ninja
mtklein935121b2015-09-15 06:07:47 -070037ninja
mtkleina22eabe2015-09-14 10:02:50 -070038popd