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 build_dir = os.path.dirname(os.path.realpath(__file__)) | |
306 project_dir = os.path.relpath(project_dir, build_dir) | |
scottmg
2014/03/18 17:04:12
BASEDIR from above instead of local build_dir
| |
307 selected_files = selected_files.split(';') | |
308 ninja_targets = [os.path.join(project_dir, filename) + '^^' | |
309 for filename in selected_files] | |
310 cmd = ['ninja.exe'] | |
311 cmd.extend(ninja_targets) | |
312 return subprocess.call(cmd, shell=True, cwd=build_dir) | |
313 | |
302 if __name__ == '__main__': | 314 if __name__ == '__main__': |
303 sys.exit(main(sys.argv[1:])) | 315 sys.exit(main(sys.argv[1:])) |
OLD | NEW |