• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright 2019 Google LLC
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# This assumes it is being run inside a docker container of emsdk-base
8# and a Skia checkout has been mounted at /SRC and the output directory
9# has been mounted at /OUT
10
11# For example:
12# docker run -v $SKIA_ROOT:/SRC -v /tmp/cmake_out:/OUT gcr.io/skia-public/cmake-release:3.13.1_v1 /SRC/infra/cmake/build_skia.sh
13
14
15set -xe
16
17#BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/cmake)
18BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd`
19SKIA_DIR=`cd $BASE_DIR/../.. && pwd`
20
21# Delete everything to do a clean build
22rm -rf $SKIA_DIR/out/CMAKE
23mkdir --mode=0777 -p $SKIA_DIR/out/CMAKE
24
25cd $SKIA_DIR
26gn gen out/CMAKE --args='is_debug=false' --ide=json --json-ide-script=../../gn/gn_to_cmake.py
27
28cd $SKIA_DIR/out/CMAKE
29cmake -G"CodeBlocks - Unix Makefiles" .
30cmake --build . --parallel 8
31
32# Copy build products, ignoring the warning
33# for not copying directories.
34cp $SKIA_DIR/out/CMAKE/* /OUT || true
35chmod +rw /OUT/*
36