| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Defines the configuration of Goma. | 5 # Defines the configuration of Goma. |
| 6 # | 6 # |
| 7 # This is currently designed to match the GYP build exactly, so as not to break | 7 # This is currently designed to match the GYP build exactly, so as not to break |
| 8 # people during the transition. | 8 # people during the transition. |
| 9 # | 9 # |
| 10 # TODO(brettw) make Android work like normal Linux. It's silly that Android has | 10 # TODO(brettw) make Android work like normal Linux. It's silly that Android has |
| 11 # completely different logic for configuring Goma. | 11 # completely different logic for configuring Goma. |
| 12 | 12 |
| 13 declare_args() { | 13 declare_args() { |
| 14 use_goma = false | 14 use_goma = false |
| 15 | 15 |
| 16 goma_dir = "" | 16 goma_dir = "" |
| 17 | |
| 18 # Goma directory used by the Android build. Empty means use the GOMA_DIR | |
| 19 # environment variable. | |
| 20 # | |
| 21 # TODO(brettw) remove this and make it work like regular Linux. | |
| 22 android_goma_dir = "" | |
| 23 } | 17 } |
| 24 | 18 |
| 25 # The Android GYP build has some logic that automatically turns on goma when | 19 # The Android GYP build has some logic that automatically turns on goma when |
| 26 # the directory is set, but this isn't done for other platforms. | 20 # the directory is set, but this isn't done for other platforms. |
| 27 # TODO(brettw) rationalize all Linux-y platforms. | 21 # TODO(brettw) rationalize all Linux-y platforms. |
| 28 if (is_android && android_goma_dir != "") { | 22 if (is_android) { |
| 29 use_goma = true | 23 if (goma_dir == "") { |
| 24 goma_dir = exec_script("android/default_goma_for_android.py", [], "value") |
| 25 } |
| 26 if (goma_dir != "") { |
| 27 use_goma = true |
| 28 } |
| 30 } | 29 } |
| 31 | 30 |
| 32 if (use_goma && goma_dir == "") { | 31 if (use_goma && goma_dir == "") { |
| 33 # Set the default goma directory. This must be a character-for-character | 32 # Set the default goma directory. This must be a character-for-character |
| 34 # match for the GYP default or else the compilers for the different targets | 33 # match for the GYP default or else the compilers for the different targets |
| 35 # won't match and GYP will assert. | 34 # won't match and GYP will assert. |
| 36 if (is_win) { | 35 if (is_win) { |
| 37 goma_dir = "c:\goma\goma-win" | 36 goma_dir = "c:\goma\goma-win" |
| 38 } else if (is_android) { | |
| 39 goma_dir = exec_script("android/default_goma_for_android.py", [], "value") | |
| 40 } else { | 37 } else { |
| 41 goma_dir = exec_script("get_default_posix_goma_dir.py", [], "value") | 38 goma_dir = exec_script("get_default_posix_goma_dir.py", [], "value") |
| 42 } | 39 } |
| 43 } | 40 } |
| 44 | 41 |
| 45 if (use_goma) { | 42 if (use_goma) { |
| 46 # Define the toolchain for the GYP build when using goma. | 43 # Define the toolchain for the GYP build when using goma. |
| 47 make_goma_global_settings = | 44 make_goma_global_settings = |
| 48 "'make_global_settings': [" + | 45 "'make_global_settings': [" + |
| 49 "['CC_wrapper', '$goma_dir/gomacc']," + | 46 "['CC_wrapper', '$goma_dir/gomacc']," + |
| 50 "['CXX_wrapper', '$goma_dir/gomacc']," + | 47 "['CXX_wrapper', '$goma_dir/gomacc']," + |
| 51 "['CC.host_wrapper', '$gomadir/gomacc']," + | 48 "['CC.host_wrapper', '$goma_dir/gomacc']," + |
| 52 "['CXX.host_wrapper', '$gomadir/gomacc']," + | 49 "['CXX.host_wrapper', '$goma_dir/gomacc']," + |
| 53 "]," | 50 "]," |
| 54 } | 51 } |
| OLD | NEW |