skia2/cmake/cmake_build
mtklein 7dd44673e0 CMake: control static/shared the normal CMake way.
This flips the default build mode to create a static libskia.

To create a shared libskia, pass -DBUILD_SHARED_LIBS=1 when running cmake.

BUG=skia:5341
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2009503002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review-Url: https://codereview.chromium.org/2009503002
2016-05-24 09:44:05 -07:00

43 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script for building with CMake on Skia build bots.
# If you have CMake installed on your system, you can just use it normally.
set -e
set -x
here=$(cd `dirname $0`; echo `pwd`)
cores=32
if [[ -z "$BUILDTYPE" || -z "$SKIA_OUT" ]]; then
echo "If you're a bot, you should be setting BUILDTYPE ($BUILDTYPE) and SKIA_OUT ($SKIA_OUT)."
echo "If you're not a bot, you don't want to run this script."
exit 1
fi
echo "Bootstrapping CMake"
pushd $here/../third_party/externals/cmake
./bootstrap --parallel=$cores
make -j $cores cmake
popd
echo "Building static library with bootstrapped CMake"
mkdir -p $SKIA_OUT/$BUILDTYPE
pushd $SKIA_OUT/$BUILDTYPE
$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE \
$here -G Ninja
ninja
popd
echo "Building shared library with bootstrapped CMake"
mkdir -p $SKIA_OUT/$BUILDTYPE
pushd $SKIA_OUT/$BUILDTYPE
$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=1 \
$here -G Ninja
ninja
popd