| OLD | NEW |
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 import hashlib | 6 import hashlib |
| 7 import os.path | 7 import os.path |
| 8 import re | 8 import re |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 for short_name in target_short_names: | 1710 for short_name in target_short_names: |
| 1711 master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in | 1711 master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in |
| 1712 target_short_names[short_name]]) | 1712 target_short_names[short_name]]) |
| 1713 | 1713 |
| 1714 if all_outputs: | 1714 if all_outputs: |
| 1715 master_ninja.newline() | 1715 master_ninja.newline() |
| 1716 master_ninja.build('all', 'phony', list(all_outputs)) | 1716 master_ninja.build('all', 'phony', list(all_outputs)) |
| 1717 master_ninja.default(generator_flags.get('default_target', 'all')) | 1717 master_ninja.default(generator_flags.get('default_target', 'all')) |
| 1718 | 1718 |
| 1719 | 1719 |
| 1720 def PerformBuild(data, configurations, params): |
| 1721 options = params['options'] |
| 1722 for config in configurations: |
| 1723 builddir = os.path.join(options.toplevel_dir, 'out', config) |
| 1724 arguments = ['ninja', '-C', builddir] |
| 1725 print 'Building [%s]: %s' % (config, arguments) |
| 1726 subprocess.check_call(arguments) |
| 1727 |
| 1728 |
| 1720 def GenerateOutput(target_list, target_dicts, data, params): | 1729 def GenerateOutput(target_list, target_dicts, data, params): |
| 1721 if params['options'].generator_output: | 1730 if params['options'].generator_output: |
| 1722 raise NotImplementedError, "--generator_output not implemented for ninja" | 1731 raise NotImplementedError, "--generator_output not implemented for ninja" |
| 1723 | 1732 |
| 1724 user_config = params.get('generator_flags', {}).get('config', None) | 1733 user_config = params.get('generator_flags', {}).get('config', None) |
| 1725 if user_config: | 1734 if user_config: |
| 1726 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1735 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 1727 user_config) | 1736 user_config) |
| 1728 else: | 1737 else: |
| 1729 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1738 config_names = target_dicts[target_list[0]]['configurations'].keys() |
| 1730 for config_name in config_names: | 1739 for config_name in config_names: |
| 1731 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1740 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 1732 config_name) | 1741 config_name) |
| OLD | NEW |