skia2/infra/cmake/build_skia.sh
Ben Wagner 721bab7063 Use Clang for CMake build
Despite the name, Build-Debian9-Clang-x86_64-Release-CMake was using
the default compiler, which is GCC, not Clang. Specify clang explicitly
in env vars for CMake.

Change-Id: Ibfad7b4de555a8a8acdddb8416582764b5a0640c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254639
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-11-14 22:08:38 +00:00

39 lines
1.1 KiB
Bash
Executable File

#!/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.
# This assumes it is being run inside a docker container of cmake-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 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`
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
cd $SKIA_DIR
./bin/fetch-gn
gn gen out/CMAKE --args='is_debug=false' --ide=json --json-ide-script=../../gn/gn_to_cmake.py
cd $SKIA_DIR/out/CMAKE
export CC=/usr/local/bin/clang
export CXX=/usr/local/bin/clang++
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/*