OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # This script is wrapper for Chromium that adds some support for how GYP | 7 # This script is wrapper for Chromium that adds some support for how GYP |
8 # is invoked by Chromium beyond what can be done in the gclient hooks. | 8 # is invoked by Chromium beyond what can be done in the gclient hooks. |
9 | 9 |
10 import glob | 10 import glob |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 # order_text_section=<path> http://crbug.com/330299 | 124 # order_text_section=<path> http://crbug.com/330299 |
125 # chromium_win_pch=0 http://crbug.com/297678 | 125 # chromium_win_pch=0 http://crbug.com/297678 |
126 # clang_use_chrome_plugins=1 http://crbug.com/330298 | 126 # clang_use_chrome_plugins=1 http://crbug.com/330298 |
127 # chromium_ios_signing=0 http://crbug.com/330302 | 127 # chromium_ios_signing=0 http://crbug.com/330302 |
128 # linux_use_tcmalloc=0 http://crbug.com/330303 | 128 # linux_use_tcmalloc=0 http://crbug.com/330303 |
129 # release_extra_flags=... http://crbug.com/330305 | 129 # release_extra_flags=... http://crbug.com/330305 |
130 | 130 |
131 # These tuples of (key, value, gn_arg_string) use the gn_arg_string for | 131 # These tuples of (key, value, gn_arg_string) use the gn_arg_string for |
132 # gn when the key is set to the given value in the GYP arguments. | 132 # gn when the key is set to the given value in the GYP arguments. |
133 remap_cases = [ | 133 remap_cases = [ |
| 134 ('android_webview_build', '1', 'is_android_webview_build=true'), |
134 ('branding', 'Chrome', 'is_chrome_branded=true'), | 135 ('branding', 'Chrome', 'is_chrome_branded=true'), |
135 ('buildtype', 'Official', 'is_official_build=true'), | 136 ('buildtype', 'Official', 'is_official_build=true'), |
136 ('component', 'shared_library', 'is_component_build=true'), | 137 ('component', 'shared_library', 'is_component_build=true'), |
137 ('clang', '1', 'is_clang=true'), | 138 ('clang', '1', 'is_clang=true'), |
138 ('target_arch', 'ia32', 'cpu_arch="x86"'), | 139 ('target_arch', 'ia32', 'cpu_arch="x86"'), |
139 ('target_arch', 'x64', 'cpu_arch="x64"'), | 140 ('target_arch', 'x64', 'cpu_arch="x64"'), |
140 ('target_arch', 'arm', 'cpu_arch="arm"'), | 141 ('target_arch', 'arm', 'cpu_arch="arm"'), |
141 ('target_arch', 'mipsel', 'cpu_arch="mipsel"'), | 142 ('target_arch', 'mipsel', 'cpu_arch="mipsel"'), |
142 ('fastbuild', '0', 'symbol_level=2'), | 143 ('fastbuild', '0', 'symbol_level=2'), |
143 ('fastbuild', '1', 'symbol_level=1'), | 144 ('fastbuild', '1', 'symbol_level=1'), |
144 ('fastbuild', '2', 'symbol_level=0'), | 145 ('fastbuild', '2', 'symbol_level=0'), |
145 ('OS', 'ios', 'os="ios"'), | 146 ('OS', 'ios', 'os="ios"'), |
146 ('OS', 'android', 'os="android"'), | 147 ('OS', 'android', 'os="android"'), |
147 ('chromeos', '1', 'os="chromeos"'), | 148 ('chromeos', '1', 'os="chromeos"'), |
148 ('use_aura', '1', 'use_aura=true'), | 149 ('use_aura', '1', 'use_aura=true'), |
149 ('asan', '1', 'is_asan=true'), | 150 ('asan', '1', 'is_asan=true'), |
150 ('lsan', '1', 'is_lsan=true'), | 151 ('lsan', '1', 'is_lsan=true'), |
151 ] | 152 ] |
152 for i in remap_cases: | 153 for i in remap_cases: |
153 if i[0] in vars_dict and vars_dict[i[0]] == i[1]: | 154 if i[0] in vars_dict and vars_dict[i[0]] == i[1]: |
154 gn_args += ' ' + i[2] | 155 gn_args += ' ' + i[2] |
155 | 156 |
156 # These string arguments get passed directly. | 157 # These string arguments get passed directly as GN strings. |
157 for v in ['windows_sdk_path']: | 158 for v in ['android_src', 'windows_sdk_path']: |
158 if v in vars_dict: | 159 if v in vars_dict: |
159 gn_args += ' ' + v + '=' + EscapeStringForGN(vars_dict[v]) | 160 gn_args += ' ' + v + '=' + EscapeStringForGN(vars_dict[v]) |
160 | 161 |
| 162 # These arguments get passed directly as integers (avoiding the quoting and |
| 163 # escaping of the string ones above). |
| 164 for v in ['arm_version']: |
| 165 if v in vars_dict: |
| 166 gn_args += ' %s=%s' % (v, vars_dict[v]) |
| 167 |
161 # Set the GYP flag so BUILD files know they're being invoked in GYP mode. | 168 # Set the GYP flag so BUILD files know they're being invoked in GYP mode. |
162 gn_args += ' is_gyp=true' | 169 gn_args += ' is_gyp=true' |
163 return gn_args.strip() | 170 return gn_args.strip() |
164 | 171 |
165 | 172 |
166 def additional_include_files(supplemental_files, args=[]): | 173 def additional_include_files(supplemental_files, args=[]): |
167 """ | 174 """ |
168 Returns a list of additional (.gypi) files to include, without duplicating | 175 Returns a list of additional (.gypi) files to include, without duplicating |
169 ones that are already specified on the command line. The list of supplemental | 176 ones that are already specified on the command line. The list of supplemental |
170 include files is passed in as an argument. | 177 include files is passed in as an argument. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 # to enfore syntax checking. | 346 # to enfore syntax checking. |
340 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 347 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
341 if syntax_check and int(syntax_check): | 348 if syntax_check and int(syntax_check): |
342 args.append('--check') | 349 args.append('--check') |
343 | 350 |
344 print 'Updating projects from gyp files...' | 351 print 'Updating projects from gyp files...' |
345 sys.stdout.flush() | 352 sys.stdout.flush() |
346 | 353 |
347 # Off we go... | 354 # Off we go... |
348 sys.exit(gyp.main(args)) | 355 sys.exit(gyp.main(args)) |
OLD | NEW |