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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 if (not line.startswith('Microsoft (R) Windows (R) Resource Compiler') and | 271 if (not line.startswith('Microsoft (R) Windows (R) Resource Compiler') and |
272 not line.startswith('Copyright (C) Microsoft Corporation') and | 272 not line.startswith('Copyright (C) Microsoft Corporation') and |
273 line): | 273 line): |
274 print line | 274 print line |
275 return popen.returncode | 275 return popen.returncode |
276 | 276 |
277 def ExecActionWrapper(self, arch, rspfile, *dir): | 277 def ExecActionWrapper(self, arch, rspfile, *dir): |
278 """Runs an action command line from a response file using the environment | 278 """Runs an action command line from a response file using the environment |
279 for |arch|. If |dir| is supplied, use that as the working directory.""" | 279 for |arch|. If |dir| is supplied, use that as the working directory.""" |
280 env = self._GetEnv(arch) | 280 env = self._GetEnv(arch) |
| 281 # TODO(scottmg): This is a temporary hack to get some specific variables |
| 282 # through to actions that are set after gyp-time. http://crbug.com/333738. |
| 283 for k, v in os.environ.iteritems(): |
| 284 if k not in env: |
| 285 env[k] = v |
281 args = open(rspfile).read() | 286 args = open(rspfile).read() |
282 dir = dir[0] if dir else None | 287 dir = dir[0] if dir else None |
283 return subprocess.call(args, shell=True, env=env, cwd=dir) | 288 return subprocess.call(args, shell=True, env=env, cwd=dir) |
284 | 289 |
285 if __name__ == '__main__': | 290 if __name__ == '__main__': |
286 sys.exit(main(sys.argv[1:])) | 291 sys.exit(main(sys.argv[1:])) |
OLD | NEW |