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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 # 4 #
5 # Environment variable NACL_ARCH should be set to one of the following 5 # Environment variable NACL_ARCH should be set to one of the following
6 # values: i686 x86_64 pnacl arm 6 # values: i686 x86_64 pnacl arm
7 7
8 8
9 # NAMING CONVENTION 9 # NAMING CONVENTION
10 # ================= 10 # =================
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 --${NACL_OPTION}-mmx \ 1080 --${NACL_OPTION}-mmx \
1081 --${NACL_OPTION}-sse \ 1081 --${NACL_OPTION}-sse \
1082 --${NACL_OPTION}-sse2 \ 1082 --${NACL_OPTION}-sse2 \
1083 --${NACL_OPTION}-asm \ 1083 --${NACL_OPTION}-asm \
1084 --with-x=no \ 1084 --with-x=no \
1085 ${EXTRA_CONFIGURE_ARGS:-} 1085 ${EXTRA_CONFIGURE_ARGS:-}
1086 } 1086 }
1087 1087
1088 1088
1089 ConfigureStep_CMake() { 1089 ConfigureStep_CMake() {
1090 if [ "${VERBOSE:-}" = "1" ]; then 1090 if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
1091 MAKE_TARGETS+=" VERBOSE=1" 1091 EXTRA_CMAKE_ARGS+=" -GNinja"
1092 fi 1092 fi
1093 1093
1094 EXTRA_CMAKE_ARGS=${EXTRA_CMAKE_ARGS:-} 1094 EXTRA_CMAKE_ARGS=${EXTRA_CMAKE_ARGS:-}
1095 if [ "${NACL_LIBC}" = "newlib" ]; then 1095 if [ "${NACL_LIBC}" = "newlib" ]; then
1096 EXTRA_CMAKE_ARGS+=" -DEXTRA_INCLUDE=${NACLPORTS_INCLUDE}/glibc-compat" 1096 EXTRA_CMAKE_ARGS+=" -DEXTRA_INCLUDE=${NACLPORTS_INCLUDE}/glibc-compat"
1097 fi 1097 fi
1098 1098
1099 CC="${NACLCC}" CXX="${NACLCXX}" LogExecute cmake ${SRC_DIR} \ 1099 CC="${NACLCC}" CXX="${NACLCXX}" LogExecute cmake ${SRC_DIR} \
1100 -DCMAKE_TOOLCHAIN_FILE=${TOOLS_DIR}/XCompile-nacl.cmake \ 1100 -DCMAKE_TOOLCHAIN_FILE=${TOOLS_DIR}/XCompile-nacl.cmake \
1101 -DNACLAR=${NACLAR} \ 1101 -DNACLAR=${NACLAR} \
1102 -DNACLLD=${NACLLD} \ 1102 -DNACLLD=${NACLLD} \
1103 -DNACL_CROSS_PREFIX=${NACL_CROSS_PREFIX} \ 1103 -DNACL_CROSS_PREFIX=${NACL_CROSS_PREFIX} \
1104 -DNACL_SDK_ROOT=${NACL_SDK_ROOT} \ 1104 -DNACL_SDK_ROOT=${NACL_SDK_ROOT} \
1105 -DNACL_TOOLCHAIN_ROOT=${NACL_TOOLCHAIN_ROOT} \ 1105 -DNACL_TOOLCHAIN_ROOT=${NACL_TOOLCHAIN_ROOT} \
1106 -DCMAKE_PREFIX_PATH=${NACL_PREFIX} \ 1106 -DCMAKE_PREFIX_PATH=${NACL_PREFIX} \
1107 -DCMAKE_INSTALL_PREFIX=${PREFIX} \ 1107 -DCMAKE_INSTALL_PREFIX=${PREFIX} \
1108 -DCMAKE_BUILD_TYPE=RELEASE ${EXTRA_CMAKE_ARGS:-} 1108 -DCMAKE_BUILD_TYPE=RELEASE ${EXTRA_CMAKE_ARGS}
1109 } 1109 }
1110 1110
1111 1111
1112 DefaultBuildStep() { 1112 DefaultBuildStep() {
1113 if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
1114 if [ "${VERBOSE:-}" = "1" ]; then
1115 NINJA_ARGS="-v"
1116 fi
1117 LogExecute ninja ${NINJA_ARGS:-} ${MAKE_TARGETS:-}
1118 return
1119 fi
1120
1113 # Build ${MAKE_TARGETS} or default target if it is not defined 1121 # Build ${MAKE_TARGETS} or default target if it is not defined
1114 if [ -n "${MAKEFLAGS:-}" ]; then 1122 if [ -n "${MAKEFLAGS:-}" ]; then
1115 echo "MAKEFLAGS=${MAKEFLAGS}" 1123 echo "MAKEFLAGS=${MAKEFLAGS}"
1116 export MAKEFLAGS 1124 export MAKEFLAGS
1117 fi 1125 fi
1118 if [ "${VERBOSE:-}" = "1" ]; then 1126 if [ "${VERBOSE:-}" = "1" ]; then
1119 MAKE_TARGETS+=" VERBOSE=1 V=1" 1127 MAKE_TARGETS+=" VERBOSE=1 V=1"
1120 fi 1128 fi
1121 export PATH=${NACL_BIN_PATH}:${PATH} 1129 export PATH=${NACL_BIN_PATH}:${PATH}
1122 LogExecute make -j${OS_JOBS} ${MAKE_TARGETS:-} 1130 LogExecute make -j${OS_JOBS} ${MAKE_TARGETS:-}
(...skipping 26 matching lines...) Expand all
1149 echo "No tests defined for ${PACKAGE_NAME}" 1157 echo "No tests defined for ${PACKAGE_NAME}"
1150 } 1158 }
1151 1159
1152 1160
1153 DefaultPostInstallTestStep() { 1161 DefaultPostInstallTestStep() {
1154 echo "No post-packaging tests defined for ${PACKAGE_NAME}" 1162 echo "No post-packaging tests defined for ${PACKAGE_NAME}"
1155 } 1163 }
1156 1164
1157 1165
1158 DefaultInstallStep() { 1166 DefaultInstallStep() {
1167 INSTALL_TARGETS=${INSTALL_TARGETS:-install}
1168
1169 if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
1170 DESTDIR=${DESTDIR} LogExecute ninja ${INSTALL_TARGETS}
1171 return
1172 fi
1173
1159 # assumes pwd has makefile 1174 # assumes pwd has makefile
1160 if [ -n "${MAKEFLAGS:-}" ]; then 1175 if [ -n "${MAKEFLAGS:-}" ]; then
1161 echo "MAKEFLAGS=${MAKEFLAGS}" 1176 echo "MAKEFLAGS=${MAKEFLAGS}"
1162 export MAKEFLAGS 1177 export MAKEFLAGS
1163 fi 1178 fi
1164 export PATH=${NACL_BIN_PATH}:${PATH} 1179 export PATH=${NACL_BIN_PATH}:${PATH}
1165 LogExecute make ${INSTALL_TARGETS:-install} DESTDIR=${DESTDIR} 1180 LogExecute make ${INSTALL_TARGETS} DESTDIR=${DESTDIR}
1166 } 1181 }
1167 1182
1168 1183
1169 DefaultPythonModuleInstallStep() { 1184 DefaultPythonModuleInstallStep() {
1170 Banner "Installing ${PACKAGE_NAME}" 1185 Banner "Installing ${PACKAGE_NAME}"
1171 # We've installed already previously. We just need to collect our modules. 1186 # We've installed already previously. We just need to collect our modules.
1172 MakeDir ${NACL_HOST_PYROOT}/python_modules/ 1187 MakeDir ${NACL_HOST_PYROOT}/python_modules/
1173 if [ -e ${START_DIR}/modules.list ] ; then 1188 if [ -e ${START_DIR}/modules.list ] ; then
1174 LogExecute cp ${START_DIR}/modules.list \ 1189 LogExecute cp ${START_DIR}/modules.list \
1175 ${DEST_PYTHON_OBJS}/${PACKAGE_NAME}.list 1190 ${DEST_PYTHON_OBJS}/${PACKAGE_NAME}.list
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 # These functions are called when this script is imported to do 1597 # These functions are called when this script is imported to do
1583 # any essential checking/setup operations. 1598 # any essential checking/setup operations.
1584 ###################################################################### 1599 ######################################################################
1585 CheckToolchain 1600 CheckToolchain
1586 CheckPatchVersion 1601 CheckPatchVersion
1587 CheckSDKVersion 1602 CheckSDKVersion
1588 PatchSpecFile 1603 PatchSpecFile
1589 InjectSystemHeaders 1604 InjectSystemHeaders
1590 InstallConfigSite 1605 InstallConfigSite
1591 GetRevision 1606 GetRevision
OLDNEW
« 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