Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2275)

Unified Diff: build_tools/common.sh

Issue 553973003: Enable cmake builds to (optionally) use ninja (Closed) Base URL: https://naclports.googlecode.com/svn/trunk/src
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build_tools/common.sh
diff --git a/build_tools/common.sh b/build_tools/common.sh
index 90337fa5d2d9665f23cf7bf42fcb89c4bc152d3d..3ee27676c3b9564c107aaaf242173ef91a6b41f2 100644
--- a/build_tools/common.sh
+++ b/build_tools/common.sh
@@ -1087,8 +1087,8 @@ ConfigureStep_Autotools() {
ConfigureStep_CMake() {
- if [ "${VERBOSE:-}" = "1" ]; then
- MAKE_TARGETS+=" VERBOSE=1"
+ if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
+ EXTRA_CMAKE_ARGS+=" -GNinja"
fi
EXTRA_CMAKE_ARGS=${EXTRA_CMAKE_ARGS:-}
@@ -1105,11 +1105,19 @@ ConfigureStep_CMake() {
-DNACL_TOOLCHAIN_ROOT=${NACL_TOOLCHAIN_ROOT} \
-DCMAKE_PREFIX_PATH=${NACL_PREFIX} \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
- -DCMAKE_BUILD_TYPE=RELEASE ${EXTRA_CMAKE_ARGS:-}
+ -DCMAKE_BUILD_TYPE=RELEASE ${EXTRA_CMAKE_ARGS}
}
DefaultBuildStep() {
+ if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
+ if [ "${VERBOSE:-}" = "1" ]; then
+ NINJA_ARGS="-v"
+ fi
+ LogExecute ninja ${NINJA_ARGS:-} ${MAKE_TARGETS:-}
+ return
+ fi
+
# Build ${MAKE_TARGETS} or default target if it is not defined
if [ -n "${MAKEFLAGS:-}" ]; then
echo "MAKEFLAGS=${MAKEFLAGS}"
@@ -1156,13 +1164,20 @@ DefaultPostInstallTestStep() {
DefaultInstallStep() {
+ INSTALL_TARGETS=${INSTALL_TARGETS:-install}
+
+ if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
+ DESTDIR=${DESTDIR} LogExecute ninja ${INSTALL_TARGETS}
+ return
+ fi
+
# assumes pwd has makefile
if [ -n "${MAKEFLAGS:-}" ]; then
echo "MAKEFLAGS=${MAKEFLAGS}"
export MAKEFLAGS
fi
export PATH=${NACL_BIN_PATH}:${PATH}
- LogExecute make ${INSTALL_TARGETS:-install} DESTDIR=${DESTDIR}
+ LogExecute make ${INSTALL_TARGETS} DESTDIR=${DESTDIR}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698