test - Run unit tests (does not build).
perftest - Run perf tests (does not build).
pytest - Run Python unit tests.
- gyp - Run gyp for mojo (does not sync), with clang.
+ gyp - Run gyp for mojo (does not sync).
+ gypall - Run gyp for all of chromium (does not sync).
sync - Sync using gclient (does not run gyp).
show-bash-alias - Outputs an appropriate bash alias for mojob. In bash do:
\$ eval \`mojo/tools/mojob.sh show-bash-alias\`
Component options:
--shared Build components as shared libraries (default).
--static Build components as static libraries.
- Mojo in chromium/content (crbug.com/353602):
- --use-mojo - Enabled (default).
- --no-use-mojo - Disabled.
+ Use goma:
+ --use-goma - Use goma if \$GOMA_DIR is set or \$HOME/goma exists (default).
+ --no-use-goma - Do not use goma.
Note: It will abort on the first failure (if any).
EOF
do_build() {
echo "Building in out/$1 ..."
- ninja -C "out/$1" mojo || exit 1
+ if [ "$GOMA" = "auto" -a -v GOMA_DIR ]; then
+ ninja -j 1000 -C "out/$1" mojo || exit 1
+ else
+ ninja -C "out/$1" mojo || exit 1
+ fi
}
do_unittests() {
do_gyp() {
local gyp_defines="$(make_gyp_defines)"
- echo "Running gyp with GYP_DEFINES=$gyp_defines ..."
+ echo "Running gyp for mojo with GYP_DEFINES=$gyp_defines ..."
GYP_DEFINES="$gyp_defines" build/gyp_chromium mojo/mojo.gyp || exit 1
}
+do_gypall() {
+ local gyp_defines="$(make_gyp_defines)"
+ echo "Running gyp for everything with GYP_DEFINES=$gyp_defines ..."
+ GYP_DEFINES="$gyp_defines" build/gyp_chromium || exit 1
+}
+
do_sync() {
# Note: sync only (with hooks, but no gyp-ing).
GYP_CHROMIUM_NO_ACTION=1 gclient sync || exit 1
COMPILER=clang
# Valid values: shared or static.
COMPONENT=shared
+# Valid values: auto or disabled.
+GOMA=auto
make_gyp_defines() {
local options=()
# Always include these options.
options+=("component=static_library")
;;
esac
- echo ${options[*]}
+ case "$GOMA" in
+ auto)
+ if [ -v GOMA_DIR ]; then
+ options+=("use_goma=1" "gomadir=\"${GOMA_DIR}\"")
+ else
+ options+=("use_goma=0")
+ fi
+ ;;
+ disabled)
+ options+=("use_goma=0")
+ ;;
+ esac
+ echo "${options[*]}"
+}
+
+set_goma_dir_if_necessary() {
+ if [ "$GOMA" = "auto" -a ! -v GOMA_DIR ]; then
+ if [ -d "${HOME}/goma" ]; then
+ GOMA_DIR="${HOME}/goma"
+ fi
+ fi
+}
+
+start_goma_if_necessary() {
+ if [ "$GOMA" = "auto" -a -v GOMA_DIR ]; then
+ "${GOMA_DIR}/goma_ctl.py" ensure_start
+ fi
}
# We're in src/mojo/tools. We want to get to src.
exit 0
;;
build)
+ set_goma_dir_if_necessary
+ start_goma_if_necessary
should_do_Debug && do_build Debug
should_do_Release && do_build Release
;;
do_pytests
;;
gyp)
+ set_goma_dir_if_necessary
do_gyp
;;
+ gypall)
+ set_goma_dir_if_necessary
+ do_gypall
+ ;;
sync)
do_sync
;;
--static)
COMPONENT=static
;;
+ --use-goma)
+ GOMA=auto
+ ;;
+ --no-use-goma)
+ GOMA=disabled
+ ;;
*)
echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"."
exit 1