cmake_build: support SKIA_OUT and BUILDTYPE

And, fix BUILDTYPE=Debug build.
EQUAL is for numbers, STREQUAL for strings.

BUG=skia:

Review URL: https://codereview.chromium.org/1341763003
This commit is contained in:
mtklein 2015-09-14 12:02:32 -07:00 committed by Commit bot
parent 59ce45fe79
commit 0faed58bc7
2 changed files with 18 additions and 6 deletions

View File

@ -54,7 +54,7 @@ remove_srcs (../src/utils/SkThreadUtils_pthread_*.cpp)
remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/xml/*)
# Some files only contain code in Debug mode. This quiets down some linker warnings.
if (NOT CMAKE_BUILD_TYPE EQUAL Debug)
if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
remove_srcs (../src/core/SkDebug.cpp ../src/utils/SkDumpCanvas.cpp)
endif()
@ -83,10 +83,10 @@ if (NOT APPLE)
endif()
# Remove processor-specific source files.
if (NOT CMAKE_SYSTEM_PROCESSOR EQUAL ARM)
if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ARM)
remove_srcs(../src/*arm* ../src/*ARM* ../src/*neon* ../src/*NEON*)
endif()
if (NOT CMAKE_SYSTEM_PROCESSOR EQUAL MIPS)
if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL MIPS)
remove_srcs(../src/*mips* ../src/*MIPS*)
endif()

View File

@ -10,9 +10,20 @@
set -e
set -x
here=`dirname $0`
fulldir() {
cd `dirname $1`
echo `pwd`
}
here=`fulldir $0`
cores=32
if [[ -z "$BUILDTYPE" || -z "$SKIA_OUT" ]]; then
echo "If you're a bot, you should be setting BUILDTYPE ($BUILDTYPE) and SKIA_OUT ($SKIA_OUT)."
echo "If you're not a bot, you don't want to run this script."
exit 1
fi
echo "Bootstrapping CMake"
pushd $here/../third_party/externals/cmake
./bootstrap --parallel=$cores
@ -20,7 +31,8 @@ make -j $cores
popd
echo "Building with bootstrapped CMake"
pushd $here
../third_party/externals/cmake/bin/cmake . -G Ninja
mkdir -p $SKIA_OUT
pushd $SKIA_OUT
$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE $here -G Ninja
ninja skia # The default also builds `example`, which I'm leaving a TODO for now.
popd