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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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:])) |
OLD | NEW |