diff options
-rw-r--r-- | app/app.gyp | 19 | ||||
-rw-r--r-- | build/common.gypi | 70 | ||||
-rw-r--r-- | chrome/chrome.gyp | 60 | ||||
-rw-r--r-- | chrome/default_plugin/default_plugin.gyp | 8 | ||||
-rw-r--r-- | gfx/gfx.gyp | 6 | ||||
-rw-r--r-- | net/net.gyp | 3 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.gypi | 9 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.gypi | 5 |
8 files changed, 75 insertions, 105 deletions
diff --git a/app/app.gyp b/app/app.gyp index 8bcc0e3..1a40b50 100644 --- a/app/app.gyp +++ b/app/app.gyp @@ -105,16 +105,9 @@ '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(RULE_INPUT_ROOT)/<(RULE_INPUT_ROOT)_ZZLOCALE.pak\' <(locales))', ], 'action': ['<@(grit_cmd)', '-i', '<(RULE_INPUT_PATH)', - 'build', '-o', '<(grit_out_dir)/<(RULE_INPUT_ROOT)'], + 'build', '-o', '<(grit_out_dir)/<(RULE_INPUT_ROOT)', + '<@(grit_defines)'], 'message': 'Generating resources from <(RULE_INPUT_PATH)', - 'conditions': [ - ['use_titlecase_in_grd_files==1', { - 'action': ['-D', 'use_titlecase'], - }], - ['chromeos==1', { - 'action': ['-D', 'chromeos'], - }], - ], }, ], 'sources': [ @@ -150,12 +143,8 @@ ], 'action': ['<@(grit_cmd)', '-i', '<(input_path)', 'build', - '-o', '<(grit_out_dir)/app_resources'], - 'conditions': [ - ['toolkit_views==1', { - 'action': ['-D', 'toolkit_views'], - }], - ], + '-o', '<(grit_out_dir)/app_resources', + '<@(grit_defines)' ], 'message': 'Generating resources from <(input_path)', }, ], diff --git a/build/common.gypi b/build/common.gypi index b26818f..ae5f41a 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -17,11 +17,16 @@ # we need to have 'chromeos' already set). 'variables': { 'variables': { - # Whether we're building a ChromeOS build. - 'chromeos%': '0', + 'variables': { + # Whether we're building a ChromeOS build. + 'chromeos%': 0, - # Disable touch support by default. - 'touchui%': 0, + # Disable touch support by default. + 'touchui%': 0, + }, + # Copy conditionally-set variables out one scope. + 'chromeos%': '<(chromeos)', + 'touchui%': '<(touchui)', # To do a shared build on linux we need to be able to choose between # type static_library and shared_library. We default to doing a static @@ -42,6 +47,14 @@ }, { # OS!="linux" 'host_arch%': 'ia32', }], + + # Set default value of toolkit_views on for Windows, Chrome OS + # and the touch UI. + ['OS=="win" or chromeos==1 or touchui==1', { + 'toolkit_views%': 1, + }, { + 'toolkit_views%': 0, + }], ], }, @@ -50,6 +63,7 @@ 'touchui%': '<(touchui)', 'host_arch%': '<(host_arch)', 'library%': '<(library)', + 'toolkit_views%': '<(toolkit_views)', # Override branding to select the desired branding flavor. 'branding%': 'Chromium', @@ -102,15 +116,10 @@ # it can be overriden by the GYP command line or by ~/.gyp/include.gypi. 'component%': '<(library)', - 'conditions': [ - # Set default value of toolkit_views on for Windows, Chrome OS - # and the touch UI. - ['OS=="win" or chromeos==1 or touchui==1', { - 'toolkit_views%': 1, - }, { - 'toolkit_views%': 0, - }], + # Set to select the Title Case versions of strings in GRD files. + 'use_titlecase_in_grd_files%': 0, + 'conditions': [ # A flag to enable or disable our compile-time dependency # on gnome-keyring. If that dependency is disabled, no gnome-keyring # support will be available. This option is useful @@ -129,6 +138,11 @@ 'linux_fpic%': 1, }], + ['toolkit_views==0 or OS=="mac"', { + # GTK+ and Mac wants Title Case strings + 'use_titlecase_in_grd_files%': 1, + }], + # Enable some hacks to support Flapper only on Chrome OS. ['chromeos==1', { 'enable_flapper_hacks%': 1, @@ -158,6 +172,7 @@ 'disable_sse2%': '<(disable_sse2)', 'library%': '<(library)', 'component%': '<(component)', + 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)', # The release channel that this build targets. This is used to restrict # channel-specific build options, like which installer packages to create. @@ -277,9 +292,6 @@ # Set to 1 to link against libgnome-keyring instead of using dlopen(). 'linux_link_gnome_keyring%': 0, - # Set to select the Title Case versions of strings in GRD files. - 'use_titlecase_in_grd_files%': 0, - # Used to disable Native Client at compile time, for platforms where it # isn't supported 'disable_nacl%': 0, @@ -319,7 +331,7 @@ # This allows to use libcros from the current system, ie. /usr/lib/ # The cros_api will be pulled in as a static library, and all headers # from the system include dirs. - 'system_libcros%': '0', + 'system_libcros%': 0, # Remoting compilation is enabled by default. Set to 0 to disable. 'remoting%': 1, @@ -335,6 +347,8 @@ 'vi', 'zh-CN', 'zh-TW', ], + 'grit_defines': [], + # Use Harfbuzz-NG instead of Harfbuzz. # Under development: http://crbug.com/68551 'use_harfbuzz_ng%': 0, @@ -355,15 +369,10 @@ ['(branding=="Chrome" and buildtype=="Official")', { 'linux_dump_symbols%': 1, }], - ['toolkit_views==0', { - # GTK wants Title Case strings - 'use_titlecase_in_grd_files%': 1, - }], ], }], # OS=="linux" or OS=="freebsd" or OS=="openbsd" + ['OS=="mac"', { - # Mac wants Title Case strings - 'use_titlecase_in_grd_files%': 1, 'conditions': [ # mac_product_name is set to the name of the .app bundle as it should # appear on disk. This duplicates data from @@ -388,6 +397,7 @@ }], ], }], # OS=="mac" + # Whether to use multiple cores to compile with visual studio. This is # optional because it sometimes causes corruption on VS 2005. # It is on by default on VS 2008 and off on VS 2005. @@ -414,11 +424,13 @@ 'NACL_WIN64', ], }], + ['OS=="mac" or (OS=="linux" and chromeos==0 and target_arch!="arm")', { 'use_cups%': 1, }, { 'use_cups%': 0, }], + # Set the relative path from this file to the GYP file of the JPEG # library used by Chromium. ['use_libjpeg_turbo==1', { @@ -426,6 +438,20 @@ }, { 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp', }], # use_libjpeg_turbo==1 + + # Setup -D flags passed into grit. + ['chromeos==1', { + 'grit_defines': ['-D', 'chromeos'], + }], + ['toolkit_views==1', { + 'grit_defines': ['-D', 'toolkit_views'], + }], + ['touchui==1', { + 'grit_defines': ['-D', 'touchui'], + }], + ['use_titlecase_in_grd_files==1', { + 'grit_defines': ['-D', 'use_titlecase'], + }], ], }, 'target_defaults': { diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index a466ca4..84d4446 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -202,17 +202,7 @@ 'build', '-o', '<(grit_out_dir)', '-D', '<(chrome_build)', '-E', '<(branded_env)', - ], - 'conditions': [ - ['chromeos==1', { - 'action': ['-D', 'chromeos'], - }], - ['toolkit_views==1', { - 'action': ['-D', 'toolkit_views'], - }], - ['use_titlecase_in_grd_files==1', { - 'action': ['-D', 'use_titlecase'], - }], + '<@(grit_defines)', ], 'message': 'Generating resources from <(RULE_INPUT_PATH)', }, @@ -289,15 +279,8 @@ 'action': ['<@(grit_cmd)', '-i', '<(RULE_INPUT_PATH)', 'build', '-o', '<(grit_out_dir)', - '-D', '<(chrome_build)'], - 'conditions': [ - ['chromeos==1', { - 'action': ['-D', 'chromeos'], - }], - ['use_titlecase_in_grd_files==1', { - 'action': ['-D', 'use_titlecase'], - }], - ], + '-D', '<(chrome_build)', + '<@(grit_defines)' ], 'message': 'Generating resources from <(RULE_INPUT_PATH)', }, ], @@ -345,18 +328,8 @@ '<@(grit_cmd)', '-i', '<(input_path)', 'build', '-o', '<(grit_out_dir)', - '-D', '<(chrome_build)' - ], - 'conditions': [ - ['chromeos==1', { - 'action': ['-D', 'chromeos'], - }], - ['toolkit_views==1', { - 'action': ['-D', 'toolkit_views'], - }], - ['use_titlecase_in_grd_files==1', { - 'action': ['-D', 'use_titlecase'], - }], + '-D', '<(chrome_build)', + '<@(grit_defines)', ], 'message': 'Generating resources from <(input_path)', }, @@ -403,15 +376,8 @@ '<@(grit_cmd)', '-i', '<(input_path)', 'build', '-o', '<(grit_out_dir)', - '-D', '<(chrome_build)' - ], - 'conditions': [ - ['chromeos==1', { - 'action': ['-D', 'chromeos'], - }], - ['use_titlecase_in_grd_files==1', { - 'action': ['-D', 'use_titlecase'], - }], + '-D', '<(chrome_build)', + '<@(grit_defines)', ], 'message': 'Generating resources from <(input_path)', }, @@ -475,17 +441,7 @@ 'build', '-o', '<(grit_out_dir)', '-D', '<(chrome_build)', '-E', '<(branded_env)', - ], - 'conditions': [ - ['chromeos==1', { - 'action': ['-D', 'chromeos'], - }], - ['use_titlecase_in_grd_files==1', { - 'action': ['-D', 'use_titlecase'], - }], - ['touchui==1', { - 'action': ['-D', 'touchui'], - }], + '<@(grit_defines)', ], 'message': 'Generating resources from <(RULE_INPUT_PATH)', }, diff --git a/chrome/default_plugin/default_plugin.gyp b/chrome/default_plugin/default_plugin.gyp index a0d8a6d..e82f15e 100644 --- a/chrome/default_plugin/default_plugin.gyp +++ b/chrome/default_plugin/default_plugin.gyp @@ -79,12 +79,8 @@ ], 'action': ['<@(grit_cmd)', '-i', '<(input_path)', 'build', - '-o', '<(grit_out_dir)/default_plugin_resources'], - 'conditions': [ - ['toolkit_views==1', { - 'action': ['-D', 'toolkit_views'], - }], - ], + '-o', '<(grit_out_dir)/default_plugin_resources', + '<@(grit_defines)'], 'message': 'Generating resources from <(input_path)', }, ], diff --git a/gfx/gfx.gyp b/gfx/gfx.gyp index 579d3b5..c24e5a0 100644 --- a/gfx/gfx.gyp +++ b/gfx/gfx.gyp @@ -201,11 +201,7 @@ '<@(grit_cmd)', '-i', '<(input_path)', 'build', '-o', '<(grit_out_dir)', - ], - 'conditions': [ - ['use_titlecase_in_grd_files==1', { - 'action': ['-D', 'use_titlecase'], - }], + '<@(grit_defines)', ], 'message': 'Generating resources from <(input_path)', }, diff --git a/net/net.gyp b/net/net.gyp index 09b6267..96ddb61 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -1224,7 +1224,8 @@ 'action': ['<@(grit_cmd)', '-i', '<(RULE_INPUT_PATH)', 'build', - '-o', '<(SHARED_INTERMEDIATE_DIR)/net'], + '-o', '<(SHARED_INTERMEDIATE_DIR)/net', + '<@(grit_defines)'], 'message': 'Generating resources from <(RULE_INPUT_PATH)', }, ], diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index 7513d70..181ea91 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -37,7 +37,8 @@ ], 'action': ['<@(grit_cmd)', '-i', '<(input_path)', 'build', - '-o', '<(grit_out_dir)'], + '-o', '<(grit_out_dir)', + '<@(grit_defines)'], 'message': 'Generating resources from <(input_path)', }, { @@ -53,7 +54,8 @@ ], 'action': ['<@(grit_cmd)', '-i', '<(input_path)', 'build', - '-o', '<(grit_out_dir)'], + '-o', '<(grit_out_dir)', + '<@(grit_defines)'], 'message': 'Generating resources from <(input_path)', }, ], @@ -89,7 +91,8 @@ ], 'action': ['<@(grit_cmd)', '-i', '<(input_path)', 'build', - '-o', '<(grit_out_dir)'], + '-o', '<(grit_out_dir)', + '<@(grit_defines)'], 'message': 'Generating resources from <(input_path)', }, ], diff --git a/webkit/tools/test_shell/test_shell.gypi b/webkit/tools/test_shell/test_shell.gypi index c954a27..b29181b 100644 --- a/webkit/tools/test_shell/test_shell.gypi +++ b/webkit/tools/test_shell/test_shell.gypi @@ -671,7 +671,10 @@ '<(out_dir)/grit/test_shell_resources.h', '<(out_dir)/test_shell_resources.pak', ], - 'action': ['python', '<(grit_path)', '-i', '<(input_path)', 'build', '-o', '<(out_dir)'], + 'action': ['python', '<(grit_path)', + '-i', '<(input_path)', + 'build', '-o', '<(out_dir)', + '<@(grit_defines)'], 'message': 'Generating resources from <(input_path)', }, ], |