aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-09-14 12:02:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-14 12:02:32 -0700
commit0faed58bc781adc8f21786943ffada1a0fc69b5a (patch)
treecbfe694339fd05f67ef7103d0613771ae02ccf7b /cmake
parent59ce45fe7984b3ee1bdbd107805a3146a0064fab (diff)
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
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeLists.txt6
-rwxr-xr-xcmake/cmake_build18
2 files changed, 18 insertions, 6 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index ea02ddda4d..36a6d1ecf3 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -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()
diff --git a/cmake/cmake_build b/cmake/cmake_build
index 2ff7a9c541..0d45d7d778 100755
--- a/cmake/cmake_build
+++ b/cmake/cmake_build
@@ -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