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 argparse | 10 import argparse |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 # assuming 'all.gyp' from the same directory as the script. | 247 # assuming 'all.gyp' from the same directory as the script. |
248 if not gyp_file_specified: | 248 if not gyp_file_specified: |
249 gyp_file = os.environ.get('CHROMIUM_GYP_FILE') | 249 gyp_file = os.environ.get('CHROMIUM_GYP_FILE') |
250 if gyp_file: | 250 if gyp_file: |
251 # Note that CHROMIUM_GYP_FILE values can't have backslashes as | 251 # Note that CHROMIUM_GYP_FILE values can't have backslashes as |
252 # path separators even on Windows due to the use of shlex.split(). | 252 # path separators even on Windows due to the use of shlex.split(). |
253 args.extend(shlex.split(gyp_file)) | 253 args.extend(shlex.split(gyp_file)) |
254 else: | 254 else: |
255 args.append(os.path.join(script_dir, 'all.gyp')) | 255 args.append(os.path.join(script_dir, 'all.gyp')) |
256 | 256 |
| 257 supplemental_includes = GetSupplementalFiles() |
| 258 gyp_vars_dict = GetGypVars(supplemental_includes) |
257 # There shouldn't be a circular dependency relationship between .gyp files, | 259 # There shouldn't be a circular dependency relationship between .gyp files, |
258 # but in Chromium's .gyp files, on non-Mac platforms, circular relationships | 260 # but in Chromium's .gyp files, on non-Mac platforms, circular relationships |
259 # currently exist. The check for circular dependencies is currently | 261 # currently exist. The check for circular dependencies is currently |
260 # bypassed on other platforms, but is left enabled on the Mac, where a | 262 # bypassed on other platforms, but is left enabled on iOS, where a violation |
261 # violation of the rule causes Xcode to misbehave badly. | 263 # of the rule causes Xcode to misbehave badly. |
262 # TODO(mark): Find and kill remaining circular dependencies, and remove this | 264 # TODO(mark): Find and kill remaining circular dependencies, and remove this |
263 # option. http://crbug.com/35878. | 265 # option. http://crbug.com/35878. |
264 # TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the | 266 # TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the |
265 # list. | 267 # list. |
266 if sys.platform not in ('darwin',): | 268 if gyp_vars_dict.get('OS') != 'ios': |
267 args.append('--no-circular-check') | 269 args.append('--no-circular-check') |
268 | 270 |
269 # We explicitly don't support the make gyp generator (crbug.com/348686). Be | 271 # We explicitly don't support the make gyp generator (crbug.com/348686). Be |
270 # nice and fail here, rather than choking in gyp. | 272 # nice and fail here, rather than choking in gyp. |
271 if re.search(r'(^|,|\s)make($|,|\s)', os.environ.get('GYP_GENERATORS', '')): | 273 if re.search(r'(^|,|\s)make($|,|\s)', os.environ.get('GYP_GENERATORS', '')): |
272 print 'Error: make gyp generator not supported (check GYP_GENERATORS).' | 274 print 'Error: make gyp generator not supported (check GYP_GENERATORS).' |
273 sys.exit(1) | 275 sys.exit(1) |
274 | 276 |
275 # We explicitly don't support the native msvs gyp generator. Be nice and | 277 # We explicitly don't support the native msvs gyp generator. Be nice and |
276 # fail here, rather than generating broken projects. | 278 # fail here, rather than generating broken projects. |
277 if re.search(r'(^|,|\s)msvs($|,|\s)', os.environ.get('GYP_GENERATORS', '')): | 279 if re.search(r'(^|,|\s)msvs($|,|\s)', os.environ.get('GYP_GENERATORS', '')): |
278 print 'Error: msvs gyp generator not supported (check GYP_GENERATORS).' | 280 print 'Error: msvs gyp generator not supported (check GYP_GENERATORS).' |
279 print 'Did you mean to use the `msvs-ninja` generator?' | 281 print 'Did you mean to use the `msvs-ninja` generator?' |
280 sys.exit(1) | 282 sys.exit(1) |
281 | 283 |
282 # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check | 284 # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check |
283 # to enfore syntax checking. | 285 # to enfore syntax checking. |
284 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 286 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
285 if syntax_check and int(syntax_check): | 287 if syntax_check and int(syntax_check): |
286 args.append('--check') | 288 args.append('--check') |
287 | 289 |
288 supplemental_includes = GetSupplementalFiles() | |
289 gyp_vars_dict = GetGypVars(supplemental_includes) | |
290 | |
291 # TODO(dmikurube): Remove these checks and messages after a while. | 290 # TODO(dmikurube): Remove these checks and messages after a while. |
292 if ('linux_use_tcmalloc' in gyp_vars_dict or | 291 if ('linux_use_tcmalloc' in gyp_vars_dict or |
293 'android_use_tcmalloc' in gyp_vars_dict): | 292 'android_use_tcmalloc' in gyp_vars_dict): |
294 print '*****************************************************************' | 293 print '*****************************************************************' |
295 print '"linux_use_tcmalloc" and "android_use_tcmalloc" are deprecated!' | 294 print '"linux_use_tcmalloc" and "android_use_tcmalloc" are deprecated!' |
296 print '-----------------------------------------------------------------' | 295 print '-----------------------------------------------------------------' |
297 print 'You specify "linux_use_tcmalloc" or "android_use_tcmalloc" in' | 296 print 'You specify "linux_use_tcmalloc" or "android_use_tcmalloc" in' |
298 print 'your GYP_DEFINES. Please switch them into "use_allocator" now.' | 297 print 'your GYP_DEFINES. Please switch them into "use_allocator" now.' |
299 print 'See http://crbug.com/345554 for the details.' | 298 print 'See http://crbug.com/345554 for the details.' |
300 print '*****************************************************************' | 299 print '*****************************************************************' |
(...skipping 22 matching lines...) Expand all Loading... |
323 | 322 |
324 if not use_analyzer: | 323 if not use_analyzer: |
325 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() | 324 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() |
326 if vs2013_runtime_dll_dirs: | 325 if vs2013_runtime_dll_dirs: |
327 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | 326 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
328 vs_toolchain.CopyVsRuntimeDlls( | 327 vs_toolchain.CopyVsRuntimeDlls( |
329 os.path.join(chrome_src, GetOutputDirectory()), | 328 os.path.join(chrome_src, GetOutputDirectory()), |
330 (x86_runtime, x64_runtime)) | 329 (x86_runtime, x64_runtime)) |
331 | 330 |
332 sys.exit(gyp_rc) | 331 sys.exit(gyp_rc) |
OLD | NEW |