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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 return vars_dict | 108 return vars_dict |
109 | 109 |
110 | 110 |
111 def GetArgsStringForGN(supplemental_files): | 111 def GetArgsStringForGN(supplemental_files): |
112 """Returns the args to pass to GN. | 112 """Returns the args to pass to GN. |
113 Based on a subset of the GYP variables that have been rewritten a bit.""" | 113 Based on a subset of the GYP variables that have been rewritten a bit.""" |
114 | 114 |
115 vars_dict = GetGypVarsForGN(supplemental_files) | 115 vars_dict = GetGypVarsForGN(supplemental_files) |
116 gn_args = '' | 116 gn_args = '' |
117 | 117 |
118 # Note: These are the additional flags passed to various builds by builders | |
119 # on the main waterfall. We'll probably need to add these at some point: | |
120 # mac_strip_release=1 http://crbug.com/330301 | |
121 # linux_dump_symbols=0 http://crbug.com/330300 | |
122 # host_os=linux Probably can skip, GN knows the host OS. | |
Nico
2014/02/10 22:04:14
(This is used by the android webview build, which
| |
123 # gcc_version=46 Hopefully we can skip this and fix whatever uses it. | |
124 # order_text_section=<path> http://crbug.com/330299 | |
125 # chromium_win_pch=0 http://crbug.com/297678 | |
126 # clang_use_chrome_plugins=1 http://crbug.com/330298 | |
127 # chromium_ios_signing=0 http://crbug.com/330302 | |
128 # linux_use_tcmalloc=0 http://crbug.com/330303 | |
129 # release_extra_flags=... http://crbug.com/330305 | |
130 | |
118 # 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 |
119 # 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. |
120 remap_cases = [ | 133 remap_cases = [ |
121 ('branding', 'Chrome', 'is_chrome_branded=true'), | 134 ('branding', 'Chrome', 'is_chrome_branded=true'), |
122 ('buildtype', 'Official', 'is_official_build=true'), | 135 ('buildtype', 'Official', 'is_official_build=true'), |
123 ('component', 'shared_library', 'is_component_build=true'), | 136 ('component', 'shared_library', 'is_component_build=true'), |
124 ('clang', '1', 'is_clang=true'), | 137 ('clang', '1', 'is_clang=true'), |
138 ('target_arch', 'ia32', 'cpu_arch="x86"'), | |
139 ('target_arch', 'x64', 'cpu_arch="x64"'), | |
140 ('target_arch', 'arm', 'cpu_arch="arm"'), | |
141 ('fastbuild', '0', 'symbol_level=2'), | |
142 ('fastbuild', '1', 'symbol_level=1'), | |
143 ('fastbuild', '2', 'symbol_level=0'), | |
144 ('OS', 'ios', 'os="ios"'), | |
145 ('OS', 'android', 'os="android"'), | |
146 ('chromeos', '1', 'os="chromeos"'), | |
147 ('use_aura', '1', 'use_aura=true'), | |
148 ('asan', '1', 'is_asan=true'), | |
149 ('lsan', '1', 'is_lsan=true'), | |
125 ] | 150 ] |
126 for i in remap_cases: | 151 for i in remap_cases: |
127 if i[0] in vars_dict and vars_dict[i[0]] == i[1]: | 152 if i[0] in vars_dict and vars_dict[i[0]] == i[1]: |
128 gn_args += ' ' + i[2] | 153 gn_args += ' ' + i[2] |
129 | 154 |
130 # These string arguments get passed directly. | 155 # These string arguments get passed directly. |
131 for v in ['windows_sdk_path']: | 156 for v in ['windows_sdk_path']: |
132 if v in vars_dict: | 157 if v in vars_dict: |
133 gn_args += ' ' + v + '=' + EscapeStringForGN(vars_dict[v]) | 158 gn_args += ' ' + v + '=' + EscapeStringForGN(vars_dict[v]) |
134 | 159 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 # to enfore syntax checking. | 338 # to enfore syntax checking. |
314 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 339 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
315 if syntax_check and int(syntax_check): | 340 if syntax_check and int(syntax_check): |
316 args.append('--check') | 341 args.append('--check') |
317 | 342 |
318 print 'Updating projects from gyp files...' | 343 print 'Updating projects from gyp files...' |
319 sys.stdout.flush() | 344 sys.stdout.flush() |
320 | 345 |
321 # Off we go... | 346 # Off we go... |
322 sys.exit(gyp.main(args)) | 347 sys.exit(gyp.main(args)) |
OLD | NEW |