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 ctypes | 10 import ctypes |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
464 args.append('--no-circular-check') | 464 args.append('--no-circular-check') |
465 | 465 |
466 # Default to ninja on linux and windows, but only if no generator has | 466 # Default to ninja on linux and windows, but only if no generator has |
467 # explicitly been set. | 467 # explicitly been set. |
468 # Also default to ninja on mac, but only when not building chrome/ios. | 468 # Also default to ninja on mac, but only when not building chrome/ios. |
469 # . -f / --format has precedence over the env var, no need to check for it | 469 # . -f / --format has precedence over the env var, no need to check for it |
470 # . set the env var only if it hasn't been set yet | 470 # . set the env var only if it hasn't been set yet |
471 # . chromium.gyp_env has been applied to os.environ at this point already | 471 # . chromium.gyp_env has been applied to os.environ at this point already |
472 if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): | 472 if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): |
473 os.environ['GYP_GENERATORS'] = 'ninja' | 473 os.environ['GYP_GENERATORS'] = 'ninja' |
474 if sys.platform.startswith('win') and not os.environ.get('GYP_GENERATORS'): | 474 elif sys.platform.startswith('win') and not os.environ.get('GYP_GENERATORS'): |
475 os.environ['GYP_GENERATORS'] = 'ninja' | |
476 elif sys.platform.startswith('freebsd') and not os.environ.get('GYP_GENERATORS '): | |
scottmg
2014/03/03 17:31:09
80 col
also, can you rewrite these three if as:
r.c.ladan
2014/03/04 18:39:45
Done.
| |
475 os.environ['GYP_GENERATORS'] = 'ninja' | 477 os.environ['GYP_GENERATORS'] = 'ninja' |
476 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ | 478 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ |
477 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): | 479 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): |
478 os.environ['GYP_GENERATORS'] = 'ninja' | 480 os.environ['GYP_GENERATORS'] = 'ninja' |
479 | 481 |
480 # If on Windows, request that depot_tools install/update the automatic | 482 # If on Windows, request that depot_tools install/update the automatic |
481 # toolchain, and then use it (unless opted-out). | 483 # toolchain, and then use it (unless opted-out). |
482 vs2013_runtime_dll_dirs = None | 484 vs2013_runtime_dll_dirs = None |
483 depot_tools_win_toolchain = \ | 485 depot_tools_win_toolchain = \ |
484 bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) | 486 bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
570 print 'Running build/landmines.py...' | 572 print 'Running build/landmines.py...' |
571 subprocess.check_call( | 573 subprocess.check_call( |
572 [sys.executable, os.path.join(script_dir, 'landmines.py')]) | 574 [sys.executable, os.path.join(script_dir, 'landmines.py')]) |
573 | 575 |
574 if vs2013_runtime_dll_dirs: | 576 if vs2013_runtime_dll_dirs: |
575 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | 577 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
576 CopyVsRuntimeDlls(os.path.join(chrome_src, GetOutputDirectory()), | 578 CopyVsRuntimeDlls(os.path.join(chrome_src, GetOutputDirectory()), |
577 (x86_runtime, x64_runtime)) | 579 (x86_runtime, x64_runtime)) |
578 | 580 |
579 sys.exit(gyp_rc) | 581 sys.exit(gyp_rc) |
OLD | NEW |