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

Unified Diff: build/android/envsetup.sh

Issue 10834296: Second attempt at fixing Ninja build for Android and change make for host os optionally use goma (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | build/android/envsetup_functions.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/envsetup.sh
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh
index 82370ccee63ebefc9910e42cf277d31ad6fcef87..766d1bc355474ff93c5ab7e13e9811817668e6cf 100755
--- a/build/android/envsetup.sh
+++ b/build/android/envsetup.sh
@@ -95,10 +95,28 @@ if [[ -d $GOMA_DIR ]]; then
fi
export ANDROID_GOMA_WRAPPER
-export CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc)
-export CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++)
-export LINK_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc)
-export AR_target=$(basename ${ANDROID_TOOLCHAIN}/*-ar)
+# Set cross-compile targets for Ninja. The configuration is necessarily
+# different from Make because we bake absolute paths into the generated
+# makefiles whereas Ninja builds depend on the PATH variable being set in order
+# to pick up the correct version of the build tools.
+if [[ "${GYP_GENERATORS}" == "ninja" ]]; then
+ echo "Configuring environment for Ninja."
+ export CC=$(basename ${ANDROID_TOOLCHAIN}/*-gcc)
+ export CXX=$(basename ${ANDROID_TOOLCHAIN}/*-g++)
+ export AR=$(basename ${ANDROID_TOOLCHAIN}/*-ar)
+ export CC_host=gcc
+ export CXX_host=g++
Nico 2012/08/13 22:34:31 This makes it hard to build with clang I suppose?
Yaron 2012/08/13 23:12:06 True, this makes it so that ninja+clang doesn't wo
+ export AR_host=ar
+fi
+
+# Add a paranoid check to help developers accidentally switching between Ninja
+# and non-Ninja which would lead to a build break.
+if [[ "${GYP_GENERATORS}" == "ninja" && \
+ "$CC" == $(basename ${ANDROID_TOOLCHAIN}/*-gcc) ]]; then
+ echo "Warning! You are using a non-ninja gyp generator but"
+ echo "overriding the CC environment variable. Build may"
+ echo "not be correct."
+fi
# Performs a gyp_chromium run to convert gyp->Makefile for android code.
android_gyp() {
« no previous file with comments | « no previous file | build/android/envsetup_functions.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698