Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index a858b38ad6271930e1a6c4a47571e7095f18f811..4da7a16b17a5813c1bdfc2e53fc2326164491647 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -110,6 +110,11 @@ |
# Sets whether chrome is built for google tv device. |
'google_tv%': 0, |
+ # goma settings. |
+ # 1 to use goma if user specified gomadir. |
+ # 0 not to use goma even if user specified gomadir. |
+ 'use_goma%': 1, |
+ |
'conditions': [ |
# Set default value of toolkit_views based on OS. |
['OS=="win" or chromeos==1 or use_aura==1', { |
@@ -154,6 +159,17 @@ |
}, { |
'use_default_render_theme%': 0, |
}], |
+ |
+ # goma settings |
+ # TODO(ukai): download goma in default dir |
+ # by gclient hooks (as clang prebuilt binary). |
+ ['OS=="android"', { |
+ # On android, ANDROID_GOMA_WRAPPER might be gomacc path |
+ # see build/android/envsetup.sh |
+ 'gomadir%': '<!(dirname ${ANDROID_GOMA_WRAPPER})', |
+ },{ |
+ 'gomadir%': '', |
+ }], |
], |
}, |
@@ -171,6 +187,8 @@ |
'enable_touch_ui%': '<(enable_touch_ui)', |
'android_build_type%': '<(android_build_type)', |
'google_tv%': '<(google_tv)', |
+ 'use_goma%': '<(use_goma)', |
+ 'gomadir%': '<(gomadir)', |
'enable_app_list%': '<(enable_app_list)', |
'enable_message_center%': '<(enable_message_center)', |
'use_default_render_theme%': '<(use_default_render_theme)', |
@@ -616,6 +634,23 @@ |
['target_arch=="mipsel"', { |
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot', |
}], |
+ |
+ ['use_goma==1 and gomadir!=""', { |
+ # Start goma and check whether it is available or not. |
+ # TODO(ukai): add an action to setup goma which everything |
+ # depends on implicitly. If goma setup fails, re-gyp with goma off. |
+ 'conditions': [ |
+ ['OS!="win"', { |
+ 'goma_status': |
+ '<!(<(gomadir)/goma_ctl.sh ensure_start >/dev/null 2>&1 && echo ok)' |
+ }, { |
+ 'goma_status': |
+ '<!(python <(gomadir)/goma_ctl.py ensure_start >NUL 2>NUL && echo ok)' |
+ }], |
+ ] |
+ },{ |
+ 'goma_status': '', |
+ }], |
], |
# Set this to 1 to use the Google-internal file containing |
@@ -745,6 +780,9 @@ |
'enable_managed_users%': '<(enable_managed_users)', |
'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)', |
'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)', |
+ 'use_goma%': '<(use_goma)', |
+ 'gomadir%': '<(gomadir)', |
+ 'goma_status%': '<(goma_status)', |
# Use system ffmpeg instead of bundled one. |
'use_system_ffmpeg%': 0, |
@@ -1006,6 +1044,17 @@ |
'enable_rlz%': 0, |
'conditions': [ |
+ ['goma_status=="ok" and OS=="win"', { |
+ # goma doesn't support pch yet. |
+ 'chromium_win_pch': 0, |
+ # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1. |
+ 'conditions': [ |
+ ['win_z7==0', { |
+ 'fastbuild': 1, |
+ }], |
+ ], |
+ }], |
+ |
['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', { |
'windows_sdk_path%': '<(windows_sdk_default_path)', |
}, { |
@@ -4012,39 +4061,25 @@ |
}, |
}], |
['clang==1', { |
- 'conditions': [ |
- ['OS=="android"', { |
- # Android could use the goma with clang. |
- 'make_global_settings': [ |
- ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang)'], |
- ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'], |
- ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'], |
- ['CC.host', '$(CC)'], |
- ['CXX.host', '$(CXX)'], |
- ['LINK.host', '$(LINK)'], |
- ], |
- }, { |
- 'make_global_settings': [ |
- ['CC', '<(make_clang_dir)/bin/clang'], |
- ['CXX', '<(make_clang_dir)/bin/clang++'], |
- ['LINK', '$(CXX)'], |
- ['CC.host', '$(CC)'], |
- ['CXX.host', '$(CXX)'], |
- ['LINK.host', '$(LINK)'], |
- ], |
- }], |
+ 'make_global_settings': [ |
+ ['CC', '<(make_clang_dir)/bin/clang'], |
+ ['CXX', '<(make_clang_dir)/bin/clang++'], |
+ ['LINK', '$(CXX)'], |
+ ['CC.host', '$(CC)'], |
+ ['CXX.host', '$(CXX)'], |
+ ['LINK.host', '$(LINK)'], |
], |
}], |
['OS=="android" and clang==0', { |
# Hardcode the compiler names in the Makefile so that |
# it won't depend on the environment at make time. |
'make_global_settings': [ |
- ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'], |
- ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-g++)'], |
- ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'], |
- ['CC.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which gcc))'], |
- ['CXX.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'], |
- ['LINK.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'], |
+ ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'], |
+ ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'], |
+ ['LINK', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'], |
+ ['CC.host', '<!(which gcc)'], |
+ ['CXX.host', '<!(which g++)'], |
+ ['LINK.host', '<!(which g++)'], |
], |
}], |
['target_arch=="mipsel"', { |
@@ -4057,6 +4092,21 @@ |
['LINK.host', '<!(which g++)'], |
], |
}], |
+ |
+ # TODO(ukai): supports GENERATOR==make |
+ # make generator doesn't support CC_wrapper without CC |
+ # in make_global_settings yet. |
+ ['goma_status=="ok" and ("<(GENERATOR)"=="ninja" or clang==1 or OS=="android")', { |
+ 'make_global_settings': [ |
+ ['CC_wrapper', '<(gomadir)/gomacc'], |
+ ['CXX_wrapper', '<(gomadir)/gomacc'], |
+ ['CC.host_wrapper', '<(gomadir)/gomacc'], |
+ ['CXX.host_wrapper', '<(gomadir)/gomacc'], |
+ # TODO(ukai): link support |
+ # ['LINK_wrapper', '<(gomadir)/gomacc'], |
+ # ['LINK.host_wrapper', '<(gomadir)/gomacc'] |
+ ], |
+ }], |
], |
'xcode_settings': { |
# DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! |