blob: 956f1a44b5b12c6520923cb02bc47e2e5e0d0394 [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
mtkleinde5973b2015-09-15 10:17:08 -070013here=$(cd `dirname $0`; echo `pwd`)
mtkleina22eabe2015-09-14 10:02:50 -070014cores=32
15
mtklein0faed582015-09-14 12:02:32 -070016if [[ -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
mtkleina22eabe2015-09-14 10:02:50 -070022echo "Bootstrapping CMake"
23pushd $here/../third_party/externals/cmake
24./bootstrap --parallel=$cores
mtkleinde5973b2015-09-15 10:17:08 -070025make -j $cores cmake
mtkleina22eabe2015-09-14 10:02:50 -070026popd
27
mtklein7dd44672016-05-24 09:44:05 -070028echo "Building static library with bootstrapped CMake"
rmistry5d363602016-04-25 06:29:21 -070029mkdir -p $SKIA_OUT/$BUILDTYPE
30pushd $SKIA_OUT/$BUILDTYPE
mtklein7dd44672016-05-24 09:44:05 -070031$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE \
32 $here -G Ninja
33ninja
34popd
35
36echo "Building shared library with bootstrapped CMake"
37mkdir -p $SKIA_OUT/$BUILDTYPE
38pushd $SKIA_OUT/$BUILDTYPE
39$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=1 \
40 $here -G Ninja
mtklein935121b2015-09-15 06:07:47 -070041ninja
mtkleina22eabe2015-09-14 10:02:50 -070042popd