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

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: Address David's (offline) comment 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..10e69f6a4b5d59d5838c0b02945ae713928f0fe7 100755
--- a/build/android/envsetup.sh
+++ b/build/android/envsetup.sh
@@ -104,7 +104,23 @@ 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" | tr ' ' '\n' | grep -q '^clang=' | tail -n1 | \
+ grep -xq clang=1; then
+ if echo "$CC_target" | grep -q gcc; then
+ unset AR_target
Yaron 2012/09/04 17:16:19 Note that I'm actually planning to remove the *_ta
Philippe 2012/09/05 15:23:24 Yes that sounds good, please assign the underlying
+ 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