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() { |