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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 os.environ['GYP_GENERATORS'] = 'ninja' | 434 os.environ['GYP_GENERATORS'] = 'ninja' |
435 if sys.platform.startswith('win') and not os.environ.get('GYP_GENERATORS'): | 435 if sys.platform.startswith('win') and not os.environ.get('GYP_GENERATORS'): |
436 os.environ['GYP_GENERATORS'] = 'ninja' | 436 os.environ['GYP_GENERATORS'] = 'ninja' |
437 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ | 437 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ |
438 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): | 438 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): |
439 os.environ['GYP_GENERATORS'] = 'ninja' | 439 os.environ['GYP_GENERATORS'] = 'ninja' |
440 | 440 |
441 # If on windows, and the automatic toolchain has been installed by | 441 # If on windows, and the automatic toolchain has been installed by |
442 # depot_tools, then use it. | 442 # depot_tools, then use it. |
443 vs2013_runtime_dll_dirs = None | 443 vs2013_runtime_dll_dirs = None |
444 if sys.platform in ('win32', 'cygwin'): | 444 # If MSVS_VERSION is explicitly specified to be something other than 2013, |
| 445 # don't use the automatic toolchain, as it currently only supports VS2013. |
| 446 msvs_version = os.environ.get('GYP_MSVS_VERSION', '2013') |
| 447 if sys.platform in ('win32', 'cygwin') and msvs_version.startswith('2013'): |
445 import find_depot_tools | 448 import find_depot_tools |
446 depot_tools_path = find_depot_tools.add_depot_tools_to_path() | 449 depot_tools_path = find_depot_tools.add_depot_tools_to_path() |
447 toolchain = os.path.normpath(os.path.join( | 450 toolchain = os.path.normpath(os.path.join( |
448 depot_tools_path, 'win_toolchain', 'vs2013_files')) | 451 depot_tools_path, 'win_toolchain', 'vs2013_files')) |
449 version_file = os.path.join(toolchain, '.version') | 452 version_file = os.path.join(toolchain, '.version') |
450 if os.path.isdir(toolchain) and os.path.isfile(version_file): | 453 if os.path.isdir(toolchain) and os.path.isfile(version_file): |
451 os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain | 454 os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain |
452 with open(version_file, 'r') as f: | 455 with open(version_file, 'r') as f: |
453 version_is_pro = f.read().strip() == 'pro' | 456 version_is_pro = f.read().strip() == 'pro' |
454 vs2013_runtime_dll_dirs = (os.path.join(toolchain, 'sys32'), | 457 vs2013_runtime_dll_dirs = (os.path.join(toolchain, 'sys32'), |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 # from above are picked up. | 500 # from above are picked up. |
498 print 'Running build/landmines.py...' | 501 print 'Running build/landmines.py...' |
499 subprocess.check_call( | 502 subprocess.check_call( |
500 [sys.executable, os.path.join(script_dir, 'landmines.py')]) | 503 [sys.executable, os.path.join(script_dir, 'landmines.py')]) |
501 | 504 |
502 if vs2013_runtime_dll_dirs: | 505 if vs2013_runtime_dll_dirs: |
503 CopyVsRuntimeDlls(os.path.join(chrome_src, GetOutputDirectory()), | 506 CopyVsRuntimeDlls(os.path.join(chrome_src, GetOutputDirectory()), |
504 vs2013_runtime_dll_dirs) | 507 vs2013_runtime_dll_dirs) |
505 | 508 |
506 sys.exit(gyp_rc) | 509 sys.exit(gyp_rc) |
OLD | NEW |