| 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[0].replace('/', '\\')] + list(args[1:]), | 119 if sys.platform == 'win32': |
| 120 shell=True, | 120 args[0] = args[0].replace('/', '\\') |
| 121 env=env, | 121 link = subprocess.Popen(args, shell=True, env=env, |
| 122 stdout=subprocess.PIPE, | 122 stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 123 stderr=subprocess.STDOUT) | |
| 124 out, _ = link.communicate() | 123 out, _ = link.communicate() |
| 125 for line in out.splitlines(): | 124 for line in out.splitlines(): |
| 126 if (not line.startswith(' Creating library ') and | 125 if (not line.startswith(' Creating library ') and |
| 127 not line.startswith('Generating code') and | 126 not line.startswith('Generating code') and |
| 128 not line.startswith('Finished generating code')): | 127 not line.startswith('Finished generating code')): |
| 129 print line | 128 print line |
| 130 return link.returncode | 129 return link.returncode |
| 131 | 130 |
| 132 def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, | 131 def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, |
| 133 mt, rc, intermediate_manifest, *manifests): | 132 mt, rc, intermediate_manifest, *manifests): |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 project_dir = os.path.relpath(project_dir, BASE_DIR) | 304 project_dir = os.path.relpath(project_dir, BASE_DIR) |
| 306 selected_files = selected_files.split(';') | 305 selected_files = selected_files.split(';') |
| 307 ninja_targets = [os.path.join(project_dir, filename) + '^^' | 306 ninja_targets = [os.path.join(project_dir, filename) + '^^' |
| 308 for filename in selected_files] | 307 for filename in selected_files] |
| 309 cmd = ['ninja.exe'] | 308 cmd = ['ninja.exe'] |
| 310 cmd.extend(ninja_targets) | 309 cmd.extend(ninja_targets) |
| 311 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) | 310 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) |
| 312 | 311 |
| 313 if __name__ == '__main__': | 312 if __name__ == '__main__': |
| 314 sys.exit(main(sys.argv[1:])) | 313 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |