Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Side by Side Diff: pylib/gyp/win_tool.py

Issue 722073004: ninja/win: Let link-wrapper convert /s to \s in the linker command. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698