diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-10 20:43:18 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-10 20:43:18 +0000 |
commit | a6e2213f050a1b1a10cf94161370df97bf9320e1 (patch) | |
tree | a0e0d6d907ea99ecbe199c533788326256b0adc9 /build | |
parent | fca656cb7bd5737a18c809d8f44edc6a99e6bb9a (diff) | |
download | chromium_src-a6e2213f050a1b1a10cf94161370df97bf9320e1.zip chromium_src-a6e2213f050a1b1a10cf94161370df97bf9320e1.tar.gz chromium_src-a6e2213f050a1b1a10cf94161370df97bf9320e1.tar.bz2 |
Let the chromium_code variable be applied in target scope in addition to .gyp
file scope.
This extends r38519, which was incomplete.
To resolve bug 33186, I am trying to turn test_shell.gyp into test_shell.gypi,
and have webkit.gyp include it. webkit.gyp is not chromium_code, but the
targets in test_shell.gypi are.
BUG=33186
TEST=builds still work, -Werror and friends are still applied (or not)
correctly
Review URL: http://codereview.chromium.org/600047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38658 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/common.gypi | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/build/common.gypi b/build/common.gypi index 5ac7623..409d83b 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -7,10 +7,10 @@ # since gyp_chromium is automatically forcing its inclusion. { 'variables': { - # .gyp files 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. + # .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, # Variables expected to be overriden on the GYP command line (-D) or by @@ -307,6 +307,17 @@ }, 'target_defaults': { 'variables': { + # The condition that operates on chromium_code is in a target_conditions + # section, and will not have access to the default fallback value of + # chromium_code at the top of this file, or to the chromium_code + # variable placed at the root variables scope of .gyp files, because + # those variables are not set at target scope. As a workaround, + # if chromium_code is not set at target scope, define it in target scope + # to contain whatever value it has during early variable expansion. + # That's enough to make it available during target conditional + # processing. + 'chromium_code%': '<(chromium_code)', + # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html 'mac_release_optimization%': '3', # Use -O3 unless overridden 'mac_debug_optimization%': '0', # Use -O0 unless overridden @@ -402,6 +413,8 @@ }], # OS==win ], # conditions for coverage }], # coverage!=0 + ], # conditions for 'target_defaults' + 'target_conditions': [ ['chromium_code==0', { 'conditions': [ [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { @@ -473,7 +486,7 @@ }], ], }], - ], # conditions for 'target_defaults' + ], # target_conditions for 'target_defaults' 'default_configuration': 'Debug', 'configurations': { # VCLinkerTool LinkIncremental values below: |