Kevin Lubick | 3105238 | 2019-01-31 12:47:20 -0500 | [diff] [blame] | 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 | |
| 15 | set -xe |
| 16 | |
| 17 | #BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/cmake) |
| 18 | BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd` |
| 19 | SKIA_DIR=`cd $BASE_DIR/../.. && pwd` |
| 20 | |
| 21 | # Delete everything to do a clean build |
| 22 | rm -rf $SKIA_DIR/out/CMAKE |
| 23 | mkdir --mode=0777 -p $SKIA_DIR/out/CMAKE |
| 24 | |
| 25 | cd $SKIA_DIR |
| 26 | gn gen out/CMAKE --args='is_debug=false' --ide=json --json-ide-script=../../gn/gn_to_cmake.py |
| 27 | |
| 28 | cd $SKIA_DIR/out/CMAKE |
Kevin Lubick | 9a2bb09 | 2019-02-01 13:32:44 -0500 | [diff] [blame] | 29 | cmake -G"CodeBlocks - Unix Makefiles" . |
| 30 | cmake --build . --parallel 8 |
Kevin Lubick | 3105238 | 2019-01-31 12:47:20 -0500 | [diff] [blame] | 31 | |
| 32 | # Copy build products, ignoring the warning |
| 33 | # for not copying directories. |
| 34 | cp $SKIA_DIR/out/CMAKE/* /OUT || true |
| 35 | chmod +rw /OUT/* |