OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import json | 5 import json |
6 import os | 6 import os |
7 import pipes | 7 import pipes |
8 import shutil | 8 import shutil |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 # values there. | 75 # values there. |
76 gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) | 76 gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) |
77 gyp_defines_dict['windows_sdk_path'] = win8sdk | 77 gyp_defines_dict['windows_sdk_path'] = win8sdk |
78 os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) | 78 os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) |
79 for k, v in gyp_defines_dict.iteritems()) | 79 for k, v in gyp_defines_dict.iteritems()) |
80 os.environ['WINDOWSSDKDIR'] = win8sdk | 80 os.environ['WINDOWSSDKDIR'] = win8sdk |
81 os.environ['WDK_DIR'] = wdk | 81 os.environ['WDK_DIR'] = wdk |
82 # Include the VS runtime in the PATH in case it's not machine-installed. | 82 # Include the VS runtime in the PATH in case it's not machine-installed. |
83 runtime_path = ';'.join(vs2013_runtime_dll_dirs) | 83 runtime_path = ';'.join(vs2013_runtime_dll_dirs) |
84 os.environ['PATH'] = runtime_path + ';' + os.environ['PATH'] | 84 os.environ['PATH'] = runtime_path + ';' + os.environ['PATH'] |
85 print('Using automatic toolchain in %s (%s edition).' % ( | |
86 toolchain, 'Pro' if version_is_pro else 'Express')) | |
87 return vs2013_runtime_dll_dirs | 85 return vs2013_runtime_dll_dirs |
88 | 86 |
89 | 87 |
90 def CopyVsRuntimeDlls(output_dir, runtime_dirs): | 88 def CopyVsRuntimeDlls(output_dir, runtime_dirs): |
91 """Copies the VS runtime DLLs from the given |runtime_dirs| to the output | 89 """Copies the VS runtime DLLs from the given |runtime_dirs| to the output |
92 directory so that even if not system-installed, built binaries are likely to | 90 directory so that even if not system-installed, built binaries are likely to |
93 be able to run. | 91 be able to run. |
94 | 92 |
95 This needs to be run after gyp has been run so that the expected target | 93 This needs to be run after gyp has been run so that the expected target |
96 output directories are already created. | 94 output directories are already created. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 os.makedirs(out_release_nacl64) | 126 os.makedirs(out_release_nacl64) |
129 copy_runtime(out_debug, x86, 'msvc%s120d.dll') | 127 copy_runtime(out_debug, x86, 'msvc%s120d.dll') |
130 copy_runtime(out_release, x86, 'msvc%s120.dll') | 128 copy_runtime(out_release, x86, 'msvc%s120.dll') |
131 copy_runtime(out_debug_x64, x64, 'msvc%s120d.dll') | 129 copy_runtime(out_debug_x64, x64, 'msvc%s120d.dll') |
132 copy_runtime(out_release_x64, x64, 'msvc%s120.dll') | 130 copy_runtime(out_release_x64, x64, 'msvc%s120.dll') |
133 copy_runtime(out_debug_nacl64, x64, 'msvc%s120d.dll') | 131 copy_runtime(out_debug_nacl64, x64, 'msvc%s120d.dll') |
134 copy_runtime(out_release_nacl64, x64, 'msvc%s120.dll') | 132 copy_runtime(out_release_nacl64, x64, 'msvc%s120.dll') |
135 | 133 |
136 | 134 |
137 def main(): | 135 def main(): |
| 136 if len(sys.argv) < 2: |
| 137 print >>sys.stderr, 'Expected either "get_toolchain_dir" or "copy_dlls"' |
| 138 return 1 |
| 139 if sys.argv[1] == 'get_toolchain_dir': |
| 140 DownloadVsToolchain() |
| 141 print '["%s", "%s"]' % ( |
| 142 os.environ['GYP_MSVS_OVERRIDE_PATH'], os.environ['WINDOWSSDKDIR']) |
| 143 else: |
| 144 print >>sys.stderr, 'TODO: not implemented "%s"' % sys.argv[1] |
| 145 return 1 |
138 return 0 | 146 return 0 |
139 | 147 |
| 148 |
140 if __name__ == '__main__': | 149 if __name__ == '__main__': |
141 sys.exit(main()) | 150 sys.exit(main()) |
OLD | NEW |