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

Unified Diff: build/android/envsetup.sh

Issue 10918045: Fix Clang build on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/android/envsetup.sh
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh
index b0024858d70492f11ba2de8a541d7c71341a9f03..a4046f21997fd491e3f833583ff411b930677df5 100755
--- a/build/android/envsetup.sh
+++ b/build/android/envsetup.sh
@@ -104,7 +104,22 @@ export AR_target=$(echo -n ${ANDROID_TOOLCHAIN}/*-ar)
# Performs a gyp_chromium run to convert gyp->Makefile for android code.
android_gyp() {
echo "GYP_GENERATORS set to '$GYP_GENERATORS'"
- "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@"
+ # http://crbug.com/143889.
+ # In case we are doing a Clang build, we have to unset CC_target and
+ # CXX_target. Otherwise GYP ends up generating a gcc build (although we set
+ # 'clang' to 1). This behavior was introduced by
+ # 54d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83f in GYP.
+ (
+ # Fork to avoid side effects on the user's environment variables.
+ if echo "$GYP_DEFINES" | grep -q clang; then
hans 2012/09/03 13:53:19 What if i have clang=0 in my GYP_DEFINES? This loo
Philippe 2012/09/03 14:02:29 Indeed. I guess you would be the first one to have
+ if echo "$CC_target" | grep -q gcc; then
+ unset AR_target
+ unset CC_target
+ unset CXX_target
+ fi
+ fi
+ "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@"
+ )
}
# FLOCK needs to be null on system that has no flock
« 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