diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 22:19:30 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 22:19:30 +0000 |
commit | e72e55b2c02e69a0b7b095f455a7cfedaa1d91c2 (patch) | |
tree | 0d82e423cc5d8dda9094c9f5e184dc53066b4abc /build | |
parent | f7e2dd73a4b5c3344d423080c23ce2acec85dbed (diff) | |
download | chromium_src-e72e55b2c02e69a0b7b095f455a7cfedaa1d91c2.zip chromium_src-e72e55b2c02e69a0b7b095f455a7cfedaa1d91c2.tar.gz chromium_src-e72e55b2c02e69a0b7b095f455a7cfedaa1d91c2.tar.bz2 |
Some clean ups to build/common.gypi.
- Organizing variables dicts as
1) vars copied from inner scopes
2) new vars defined in current scope
3) conditions
- moving variables out of inner scopes when possible
- cleaning up/consolidating some comments
This is just a refactoring and shouldn't change any of the logic.
Review URL: http://codereview.chromium.org/6015016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70667 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/common.gypi | 189 |
1 files changed, 91 insertions, 98 deletions
diff --git a/build/common.gypi b/build/common.gypi index f914684..5d3ef05 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -6,43 +6,31 @@ # Please don't directly include this file if you are building via gyp_chromium, # since gyp_chromium is automatically forcing its inclusion. { + # Variables expected to be overriden on the GYP command line (-D) or by + # ~/.gyp/include.gypi. 'variables': { - # .gyp files or targets should set chromium_code to 1 if they build - # Chromium-specific code, as opposed to external code. This variable is - # used to control such things as the set of warnings to enable, and - # whether warnings are treated as errors. - 'chromium_code%': 0, - - 'internal_pdf%': 0, - - # 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', - - # Variables expected to be overriden on the GYP command line (-D) or by - # ~/.gyp/include.gypi. - # Putting a variables dict inside another variables dict looks kind of - # weird. This is done so that "branding" and "buildtype" are defined as + # weird. This is done so that 'host_arch', 'chromeos', etc are defined as # variables within the outer variables dict here. This is necessary # to get these variables defined for the conditions within this variables - # dict that operate on these variables. + # dict that operate on these variables (e.g., for setting 'toolkit_views', + # we need to have 'chromeos' already set). 'variables': { - # Override branding to select the desired branding flavor. - 'branding%': 'Chromium', + 'variables': { + # Whether we're building a ChromeOS build. + 'chromeos%': '0', - # Override buildtype to select the desired build flavor. - # Dev - everyday build for development/testing - # Official - release build (generally implies additional processing) - # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp - # conversion is done), some of the things which are now controlled by - # 'branding', such as symbol generation, will need to be refactored based - # on 'buildtype' (i.e. we don't care about saving symbols for non-Official - # builds). - 'buildtype%': 'Dev', + # Disable touch support by default. + 'touchui%': 0, + + # 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 + # build but you can override this with "gyp -Dlibrary=shared_library" + # or you can add the following line (without the #) to + # ~/.gyp/include.gypi {'variables': {'library': 'shared_library'}} + # to compile as shared by default + 'library%': 'static_library', - 'variables': { # Compute the architecture that we're building on. 'conditions': [ [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { @@ -55,64 +43,31 @@ 'host_arch%': 'ia32', }], ], - - # Whether we're building a ChromeOS build. We set the initial - # value at this level of nesting so it's available for the - # toolkit_views test below. - 'chromeos%': '0', - - # Disable touch support by default. - 'touchui%': 0, - - # 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 - # build but you can override this with "gyp -Dlibrary=shared_library" - # or you can add the following line (without the #) to - # ~/.gyp/include.gypi {'variables': {'library': 'shared_library'}} - # to compile as shared by default - 'library%': 'static_library', }, - # We set those at this level of nesting so the values are available for - # other conditionals below. - '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, - }], - - # 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 - # for Linux distributions. - ['chromeos==1', { - 'use_gnome_keyring%': 0, - }, { - 'use_gnome_keyring%': 1, - }], + # Copy conditionally-set variables out one scope. + 'chromeos%': '<(chromeos)', + 'touchui%': '<(touchui)', + 'host_arch%': '<(host_arch)', + 'library%': '<(library)', - # Set to 1 compile with -fPIC cflag on linux. This is a must for shared - # libraries on linux x86-64 and arm. - ['host_arch=="ia32"', { - 'linux_fpic%': 0, - }, { - 'linux_fpic%': 1, - }], - ], + # Override branding to select the desired branding flavor. + 'branding%': 'Chromium', - 'host_arch%': '<(host_arch)', + # Override buildtype to select the desired build flavor. + # Dev - everyday build for development/testing + # Official - release build (generally implies additional processing) + # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp + # conversion is done), some of the things which are now controlled by + # 'branding', such as symbol generation, will need to be refactored based + # on 'buildtype' (i.e. we don't care about saving symbols for non-Official + # builds). + 'buildtype%': 'Dev', # Default architecture we're building for is the architecture we're # building on. 'target_arch%': '<(host_arch)', - # Copy conditionally-set variables out one scope. - 'chromeos%': '<(chromeos)', - 'touchui%': '<(touchui)', - # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are # are built under a chromium full build (1) or a webkit.org chromium # build (0). @@ -137,24 +92,46 @@ # On Linux, we build with sse2 for Chromium builds. 'disable_sse2%': 0, - # Remoting compilation is enabled by default. Set to 0 to disable. - 'remoting%': 1, - # Use libjpeg-turbo as the JPEG codec used by Chromium. 'use_libjpeg_turbo%': 0, - 'library%': '<(library)', - # Variable 'component' is for cases where we would like to build some # components as dynamic shared libraries but still need variable # 'library' for static libraries. # By default, component is set to whatever library is set to and # 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, + }], + + # 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 + # for Linux distributions. + ['chromeos==1', { + 'use_gnome_keyring%': 0, + }, { + 'use_gnome_keyring%': 1, + }], + + # Set to 1 compile with -fPIC cflag on linux. This is a must for shared + # libraries on linux x86-64 and arm. + ['host_arch=="ia32"', { + 'linux_fpic%': 0, + }, { + 'linux_fpic%': 1, + }], + ], }, - # Define branding and buildtype on the basis of their settings within the - # variables sub-dict above, unless overridden. + # Copy conditionally-set variables out one scope. 'branding%': '<(branding)', 'buildtype%': '<(buildtype)', 'target_arch%': '<(target_arch)', @@ -171,7 +148,6 @@ 'arm_neon%': '<(arm_neon)', 'sysroot%': '<(sysroot)', 'disable_sse2%': '<(disable_sse2)', - 'remoting%': '<(remoting)', 'library%': '<(library)', 'component%': '<(component)', @@ -323,6 +299,34 @@ # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803 'use_openssl%': 0, + # .gyp files or targets should set chromium_code to 1 if they build + # Chromium-specific code, as opposed to external code. This variable is + # used to control such things as the set of warnings to enable, and + # whether warnings are treated as errors. + 'chromium_code%': 0, + + # Set to 1 to compile with the built in pdf viewer. + 'internal_pdf%': 0, + + # 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', + + # Remoting compilation is enabled by default. Set to 0 to disable. + 'remoting%': 1, + + # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_' + # so Cocoa is happy (http://crbug.com/20441). + 'locales': [ + 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', + 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he', + 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', + 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', + 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', + 'vi', 'zh-CN', 'zh-TW', + ], + # Use Harfbuzz-NG instead of Harfbuzz. # Under development: http://crbug.com/68551 'use_harfbuzz_ng%': 0, @@ -415,17 +419,6 @@ 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp', }], # use_libjpeg_turbo==1 ], - - # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_' - # so Cocoa is happy (http://crbug.com/20441). - 'locales': [ - 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', - 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he', - 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', - 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', - 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', - 'vi', 'zh-CN', 'zh-TW', - ], }, 'target_defaults': { 'variables': { |