| 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 gyp | 6 import gyp |
| 7 import gyp.common | 7 import gyp.common |
| 8 import gyp.msvs_emulation | 8 import gyp.msvs_emulation |
| 9 import gyp.MSVSVersion | 9 import gyp.MSVSVersion |
| 10 import gyp.system_test | 10 import gyp.system_test |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 self.WriteVariableList('cflags_objcc', map(self.ExpandSpecial, | 709 self.WriteVariableList('cflags_objcc', map(self.ExpandSpecial, |
| 710 cflags_objcc)) | 710 cflags_objcc)) |
| 711 self.ninja.newline() | 711 self.ninja.newline() |
| 712 outputs = [] | 712 outputs = [] |
| 713 for source in sources: | 713 for source in sources: |
| 714 filename, ext = os.path.splitext(source) | 714 filename, ext = os.path.splitext(source) |
| 715 ext = ext[1:] | 715 ext = ext[1:] |
| 716 obj_ext = self.obj_ext | 716 obj_ext = self.obj_ext |
| 717 if ext in ('cc', 'cpp', 'cxx'): | 717 if ext in ('cc', 'cpp', 'cxx'): |
| 718 command = 'cxx' | 718 command = 'cxx' |
| 719 elif ext in ('c', 's', 'S'): | 719 elif ext == 'c' or (ext in ('s', 'S') and self.flavor != 'win'): |
| 720 # TODO(scottmg): .s files won't be handled by the Windows compiler. |
| 721 # We could add support for .asm, though that's only supported on |
| 722 # x86. Currently not used in Chromium in favor of other third-party |
| 723 # assemblers. |
| 720 command = 'cc' | 724 command = 'cc' |
| 721 elif self.flavor == 'mac' and ext == 'm': | 725 elif self.flavor == 'mac' and ext == 'm': |
| 722 command = 'objc' | 726 command = 'objc' |
| 723 elif self.flavor == 'mac' and ext == 'mm': | 727 elif self.flavor == 'mac' and ext == 'mm': |
| 724 command = 'objcxx' | 728 command = 'objcxx' |
| 725 elif self.flavor == 'win' and ext == 'rc': | 729 elif self.flavor == 'win' and ext == 'rc': |
| 726 command = 'rc' | 730 command = 'rc' |
| 727 obj_ext = '.res' | 731 obj_ext = '.res' |
| 728 else: | 732 else: |
| 729 # Ignore unhandled extensions. | 733 # Ignore unhandled extensions. |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 | 1476 |
| 1473 user_config = params.get('generator_flags', {}).get('config', None) | 1477 user_config = params.get('generator_flags', {}).get('config', None) |
| 1474 if user_config: | 1478 if user_config: |
| 1475 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1479 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 1476 user_config) | 1480 user_config) |
| 1477 else: | 1481 else: |
| 1478 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1482 config_names = target_dicts[target_list[0]]['configurations'].keys() |
| 1479 for config_name in config_names: | 1483 for config_name in config_names: |
| 1480 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1484 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 1481 config_name) | 1485 config_name) |
| OLD | NEW |