2019-01-31 17:47:20 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright 2019 Google LLC
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2019-10-09 14:46:14 +00:00
|
|
|
# This assumes it is being run inside a docker container of cmake-release
|
2019-01-31 17:47:20 +00:00
|
|
|
# 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 gcr.io/skia-public/cmake-release:3.13.1_v1 /SRC/infra/cmake/build_skia.sh
|
|
|
|
|
|
|
|
|
|
|
|
set -xe
|
|
|
|
|
|
|
|
#BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/cmake)
|
|
|
|
BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd`
|
2020-01-13 19:43:20 +00:00
|
|
|
SKIA_DIR=`cd ${BASE_DIR}/../.. && pwd`
|
2019-01-31 17:47:20 +00:00
|
|
|
|
2020-01-13 19:43:20 +00:00
|
|
|
OUT="$(mktemp -d)/CMAKE"
|
2019-01-31 17:47:20 +00:00
|
|
|
|
2020-01-13 19:43:20 +00:00
|
|
|
cd ${SKIA_DIR}
|
2019-03-04 22:41:56 +00:00
|
|
|
./bin/fetch-gn
|
2020-01-13 19:43:20 +00:00
|
|
|
gn gen ${OUT} --args='is_debug=false' --ide=json --json-ide-script=$SKIA_DIR/gn/gn_to_cmake.py
|
2019-01-31 17:47:20 +00:00
|
|
|
|
2020-01-13 19:43:20 +00:00
|
|
|
cd ${OUT}
|
2019-11-14 20:45:28 +00:00
|
|
|
export CC=/usr/local/bin/clang
|
|
|
|
export CXX=/usr/local/bin/clang++
|
2019-02-01 18:32:44 +00:00
|
|
|
cmake -G"CodeBlocks - Unix Makefiles" .
|
|
|
|
cmake --build . --parallel 8
|
2019-01-31 17:47:20 +00:00
|
|
|
|
|
|
|
# Copy build products, ignoring the warning
|
|
|
|
# for not copying directories.
|
2020-01-13 19:43:20 +00:00
|
|
|
cp ${OUT}/* /OUT || true
|
2019-01-31 17:47:20 +00:00
|
|
|
chmod +rw /OUT/*
|