OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import glob | 6 import glob |
7 import json | 7 import json |
8 import os | 8 import os |
9 import pipes | 9 import pipes |
10 import platform | 10 import platform |
11 import re | 11 import re |
12 import shutil | 12 import shutil |
13 import stat | 13 import stat |
14 import subprocess | 14 import subprocess |
15 import sys | 15 import sys |
16 | 16 |
17 | 17 |
18 script_dir = os.path.dirname(os.path.realpath(__file__)) | 18 script_dir = os.path.dirname(os.path.realpath(__file__)) |
19 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) | 19 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) |
20 SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 20 SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
21 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) | 21 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) |
22 json_data_file = os.path.join(script_dir, 'win_toolchain.json') | 22 json_data_file = os.path.join(script_dir, 'win_toolchain.json') |
23 | 23 |
24 | 24 |
25 # Use MSVS2017 as the default toolchain. | 25 # Use MSVS2015 as the default toolchain. |
26 CURRENT_DEFAULT_TOOLCHAIN_VERSION = '2017' | 26 CURRENT_DEFAULT_TOOLCHAIN_VERSION = '2015' |
27 | 27 |
28 | 28 |
29 def SetEnvironmentAndGetRuntimeDllDirs(): | 29 def SetEnvironmentAndGetRuntimeDllDirs(): |
30 """Sets up os.environ to use the depot_tools VS toolchain with gyp, and | 30 """Sets up os.environ to use the depot_tools VS toolchain with gyp, and |
31 returns the location of the VS runtime DLLs so they can be copied into | 31 returns the location of the VS runtime DLLs so they can be copied into |
32 the output directory after gyp generation. | 32 the output directory after gyp generation. |
33 | 33 |
34 Return value is [x64path, x86path] or None | 34 Return value is [x64path, x86path] or None |
35 """ | 35 """ |
36 vs_runtime_dll_dirs = None | 36 vs_runtime_dll_dirs = None |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 'copy_dlls': CopyDlls, | 430 'copy_dlls': CopyDlls, |
431 } | 431 } |
432 if len(sys.argv) < 2 or sys.argv[1] not in commands: | 432 if len(sys.argv) < 2 or sys.argv[1] not in commands: |
433 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) | 433 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) |
434 return 1 | 434 return 1 |
435 return commands[sys.argv[1]](*sys.argv[2:]) | 435 return commands[sys.argv[1]](*sys.argv[2:]) |
436 | 436 |
437 | 437 |
438 if __name__ == '__main__': | 438 if __name__ == '__main__': |
439 sys.exit(main()) | 439 sys.exit(main()) |
OLD | NEW |