OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. 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 """Utility functions for Windows builds. | 7 """Utility functions for Windows builds. |
8 | 8 |
9 These functions are executed via gyp-win-tool when using the ninja generator. | 9 These functions are executed via gyp-win-tool when using the ninja generator. |
10 """ | 10 """ |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 shutil.copy2(source, dest) | 109 shutil.copy2(source, dest) |
110 | 110 |
111 def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): | 111 def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): |
112 """Filter diagnostic output from link that looks like: | 112 """Filter diagnostic output from link that looks like: |
113 ' Creating library ui.dll.lib and object ui.dll.exp' | 113 ' Creating library ui.dll.lib and object ui.dll.exp' |
114 This happens when there are exports from the dll or exe. | 114 This happens when there are exports from the dll or exe. |
115 """ | 115 """ |
116 env = self._GetEnv(arch) | 116 env = self._GetEnv(arch) |
117 if use_separate_mspdbsrv == 'True': | 117 if use_separate_mspdbsrv == 'True': |
118 self._UseSeparateMspdbsrv(env, args) | 118 self._UseSeparateMspdbsrv(env, args) |
119 link = subprocess.Popen(args, | 119 link = subprocess.Popen((args[0].replace('/', '\\'),) + args[1:], |
scottmg
2014/11/25 01:16:07
nit; i'd probably make it a list to avoid the trai
Nico
2014/11/25 01:19:01
You mean
[args[0].replace...0] + list(args[1:])
| |
120 shell=True, | 120 shell=True, |
121 env=env, | 121 env=env, |
122 stdout=subprocess.PIPE, | 122 stdout=subprocess.PIPE, |
123 stderr=subprocess.STDOUT) | 123 stderr=subprocess.STDOUT) |
124 out, _ = link.communicate() | 124 out, _ = link.communicate() |
125 for line in out.splitlines(): | 125 for line in out.splitlines(): |
126 if not line.startswith(' Creating library '): | 126 if not line.startswith(' Creating library '): |
127 print line | 127 print line |
128 return link.returncode | 128 return link.returncode |
129 | 129 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 project_dir = os.path.relpath(project_dir, BASE_DIR) | 306 project_dir = os.path.relpath(project_dir, BASE_DIR) |
307 selected_files = selected_files.split(';') | 307 selected_files = selected_files.split(';') |
308 ninja_targets = [os.path.join(project_dir, filename) + '^^' | 308 ninja_targets = [os.path.join(project_dir, filename) + '^^' |
309 for filename in selected_files] | 309 for filename in selected_files] |
310 cmd = ['ninja.exe'] | 310 cmd = ['ninja.exe'] |
311 cmd.extend(ninja_targets) | 311 cmd.extend(ninja_targets) |
312 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) | 312 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) |
313 | 313 |
314 if __name__ == '__main__': | 314 if __name__ == '__main__': |
315 sys.exit(main(sys.argv[1:])) | 315 sys.exit(main(sys.argv[1:])) |
OLD | NEW |