blob: 6e78dfa11bfb8f7c74b9ba50ea6c1ac083717a2d [file] [log] [blame]
# Copyright 2019 Google LLC
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This assumes it is being run inside a docker container of emsdk-release
# and a Skia checkout has been mounted at /SRC and the output directory
# has been mounted at /OUT
# For example:
# docker run -v $SKIA_ROOT:/SRC -v /tmp/cmake_out:/OUT /SRC/infra/cmake/
set -xe
#BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/cmake)
BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd`
SKIA_DIR=`cd $BASE_DIR/../.. && pwd`
# Delete everything to do a clean build
rm -rf $SKIA_DIR/out/CMAKE
mkdir --mode=0777 -p $SKIA_DIR/out/CMAKE
gn gen out/CMAKE --args='is_debug=false' --ide=json --json-ide-script=../../gn/
cmake -G"CodeBlocks - Unix Makefiles" .
cmake --build . --parallel 8
# Copy build products, ignoring the warning
# for not copying directories.
cp $SKIA_DIR/out/CMAKE/* /OUT || true
chmod +rw /OUT/*