1#!/bin/bash
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
10set -e
11set -x
12
13here=$(cd `dirname $0`; echo `pwd`)
14cores=32
15
16if [[ -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
20fi
21
22echo "Bootstrapping CMake"
23pushd $here/../third_party/externals/cmake
24./bootstrap --parallel=$cores
25make -j $cores cmake
26popd
27
28echo "Building with bootstrapped CMake"
29mkdir -p $SKIA_OUT
30pushd $SKIA_OUT
31$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE $here -G Ninja
32ninja
33popd
34