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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 # . set the env var only if it hasn't been set yet | 427 # . set the env var only if it hasn't been set yet |
428 # . chromium.gyp_env has been applied to os.environ at this point already | 428 # . chromium.gyp_env has been applied to os.environ at this point already |
429 if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): | 429 if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): |
430 os.environ['GYP_GENERATORS'] = 'ninja' | 430 os.environ['GYP_GENERATORS'] = 'ninja' |
431 if sys.platform.startswith('win') and not os.environ.get('GYP_GENERATORS'): | 431 if sys.platform.startswith('win') and not os.environ.get('GYP_GENERATORS'): |
432 os.environ['GYP_GENERATORS'] = 'ninja' | 432 os.environ['GYP_GENERATORS'] = 'ninja' |
433 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ | 433 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ |
434 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): | 434 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): |
435 os.environ['GYP_GENERATORS'] = 'ninja' | 435 os.environ['GYP_GENERATORS'] = 'ninja' |
436 | 436 |
437 # If using ninja on windows, and the automatic toolchain has been installed | 437 # If on windows, and the automatic toolchain has been installed by |
438 # by depot_tools, then use it. | 438 # depot_tools, then use it. |
439 vs2013_runtime_dll_dirs = None | 439 vs2013_runtime_dll_dirs = None |
440 if (sys.platform in ('win32', 'cygwin') and | 440 if sys.platform in ('win32', 'cygwin'): |
441 os.environ.get('GYP_GENERATORS') == 'ninja'): | |
442 depot_tools_path = find_depot_tools.add_depot_tools_to_path() | 441 depot_tools_path = find_depot_tools.add_depot_tools_to_path() |
443 toolchain = os.path.normpath(os.path.join( | 442 toolchain = os.path.normpath(os.path.join( |
444 depot_tools_path, 'win_toolchain', 'vs2013_files')) | 443 depot_tools_path, 'win_toolchain', 'vs2013_files')) |
445 version_file = os.path.join(toolchain, '.version') | 444 version_file = os.path.join(toolchain, '.version') |
446 if os.path.isdir(toolchain) and os.path.isfile(version_file): | 445 if os.path.isdir(toolchain) and os.path.isfile(version_file): |
447 os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain | 446 os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain |
448 with open(version_file, 'r') as f: | 447 with open(version_file, 'r') as f: |
449 version_is_pro = f.read().strip() == 'pro' | 448 version_is_pro = f.read().strip() == 'pro' |
450 vs2013_runtime_dll_dirs = (os.path.join(toolchain, 'sys32'), | 449 vs2013_runtime_dll_dirs = (os.path.join(toolchain, 'sys32'), |
451 os.path.join(toolchain, 'sys64')) | 450 os.path.join(toolchain, 'sys64')) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 # rather than a separate runhooks step so that any environment modifications | 491 # rather than a separate runhooks step so that any environment modifications |
493 # from above are picked up. | 492 # from above are picked up. |
494 print 'Running build/landmines.py...' | 493 print 'Running build/landmines.py...' |
495 subprocess.check_call( | 494 subprocess.check_call( |
496 [sys.executable, os.path.join(script_dir, 'landmines.py')]) | 495 [sys.executable, os.path.join(script_dir, 'landmines.py')]) |
497 | 496 |
498 if vs2013_runtime_dll_dirs: | 497 if vs2013_runtime_dll_dirs: |
499 CopyVsRuntimeDlls(GetOutputDirectory(), vs2013_runtime_dll_dirs) | 498 CopyVsRuntimeDlls(GetOutputDirectory(), vs2013_runtime_dll_dirs) |
500 | 499 |
501 sys.exit(gyp_rc) | 500 sys.exit(gyp_rc) |
OLD | NEW |