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

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

Issue 203383003: Support building selected C/C++ files in msvs-ninja (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: use BASEDIR Created 6 years, 9 months 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 | « pylib/gyp/generator/msvs.py ('k') | 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 env = self._GetEnv(arch) 292 env = self._GetEnv(arch)
293 # TODO(scottmg): This is a temporary hack to get some specific variables 293 # TODO(scottmg): This is a temporary hack to get some specific variables
294 # through to actions that are set after gyp-time. http://crbug.com/333738. 294 # through to actions that are set after gyp-time. http://crbug.com/333738.
295 for k, v in os.environ.iteritems(): 295 for k, v in os.environ.iteritems():
296 if k not in env: 296 if k not in env:
297 env[k] = v 297 env[k] = v
298 args = open(rspfile).read() 298 args = open(rspfile).read()
299 dir = dir[0] if dir else None 299 dir = dir[0] if dir else None
300 return subprocess.call(args, shell=True, env=env, cwd=dir) 300 return subprocess.call(args, shell=True, env=env, cwd=dir)
301 301
302 def ExecClCompile(self, project_dir, selected_files):
303 """Executed by msvs-ninja projects when the 'ClCompile' target is used to
304 build selected C/C++ files."""
305 project_dir = os.path.relpath(project_dir, BASE_DIR)
306 selected_files = selected_files.split(';')
307 ninja_targets = [os.path.join(project_dir, filename) + '^^'
308 for filename in selected_files]
309 cmd = ['ninja.exe']
310 cmd.extend(ninja_targets)
311 return subprocess.call(cmd, shell=True, cwd=BASE_DIR)
312
302 if __name__ == '__main__': 313 if __name__ == '__main__':
303 sys.exit(main(sys.argv[1:])) 314 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « pylib/gyp/generator/msvs.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698