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 multiprocessing | 7 import multiprocessing |
8 import os.path | 8 import os.path |
9 import re | 9 import re |
10 import signal | 10 import signal |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 for source in sources: | 790 for source in sources: |
791 filename, ext = os.path.splitext(source) | 791 filename, ext = os.path.splitext(source) |
792 ext = ext[1:] | 792 ext = ext[1:] |
793 obj_ext = self.obj_ext | 793 obj_ext = self.obj_ext |
794 if ext in ('cc', 'cpp', 'cxx'): | 794 if ext in ('cc', 'cpp', 'cxx'): |
795 command = 'cxx' | 795 command = 'cxx' |
796 elif ext == 'c' or (ext == 'S' and self.flavor != 'win'): | 796 elif ext == 'c' or (ext == 'S' and self.flavor != 'win'): |
797 command = 'cc' | 797 command = 'cc' |
798 elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files. | 798 elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files. |
799 command = 'cc_s' | 799 command = 'cc_s' |
800 elif (self.flavor == 'win' and ext == 'asm' and | 800 elif (self.flavor == 'win' and ext == 'asm' and not |
801 self.msvs_settings.GetArch(config_name) == 'x86' and | 801 self.msvs_settings.HasExplicitAsmRules(spec)): |
802 not self.msvs_settings.HasExplicitAsmRules(spec)): | |
803 # Asm files only get auto assembled for x86 (not x64). | |
804 command = 'asm' | 802 command = 'asm' |
805 # Add the _asm suffix as msvs is capable of handling .cc and | 803 # Add the _asm suffix as msvs is capable of handling .cc and |
806 # .asm files of the same name without collision. | 804 # .asm files of the same name without collision. |
807 obj_ext = '_asm.obj' | 805 obj_ext = '_asm.obj' |
808 elif self.flavor == 'mac' and ext == 'm': | 806 elif self.flavor == 'mac' and ext == 'm': |
809 command = 'objc' | 807 command = 'objc' |
810 elif self.flavor == 'mac' and ext == 'mm': | 808 elif self.flavor == 'mac' and ext == 'mm': |
811 command = 'objcxx' | 809 command = 'objcxx' |
812 elif self.flavor == 'win' and ext == 'rc': | 810 elif self.flavor == 'win' and ext == 'rc': |
813 command = 'rc' | 811 command = 'rc' |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 'rc', | 1504 'rc', |
1507 description='RC $in', | 1505 description='RC $in', |
1508 # Note: $in must be last otherwise rc.exe complains. | 1506 # Note: $in must be last otherwise rc.exe complains. |
1509 command=('%s gyp-win-tool rc-wrapper ' | 1507 command=('%s gyp-win-tool rc-wrapper ' |
1510 '$arch $rc $defines $includes $rcflags /fo$out $in' % | 1508 '$arch $rc $defines $includes $rcflags /fo$out $in' % |
1511 sys.executable)) | 1509 sys.executable)) |
1512 master_ninja.rule( | 1510 master_ninja.rule( |
1513 'asm', | 1511 'asm', |
1514 description='ASM $in', | 1512 description='ASM $in', |
1515 command=('%s gyp-win-tool asm-wrapper ' | 1513 command=('%s gyp-win-tool asm-wrapper ' |
1516 '$arch $asm $defines $includes /c /Fo $out $in' % | 1514 '$arch $defines $includes /c /Fo $out $in' % |
1517 sys.executable)) | 1515 sys.executable)) |
1518 | 1516 |
1519 if flavor != 'mac' and flavor != 'win': | 1517 if flavor != 'mac' and flavor != 'win': |
1520 master_ninja.rule( | 1518 master_ninja.rule( |
1521 'alink', | 1519 'alink', |
1522 description='AR $out', | 1520 description='AR $out', |
1523 command='rm -f $out && $ar rcs $out $in') | 1521 command='rm -f $out && $ar rcs $out $in') |
1524 master_ninja.rule( | 1522 master_ninja.rule( |
1525 'alink_thin', | 1523 'alink_thin', |
1526 description='AR $out', | 1524 description='AR $out', |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 arglists.append( | 1788 arglists.append( |
1791 (target_list, target_dicts, data, params, config_name)) | 1789 (target_list, target_dicts, data, params, config_name)) |
1792 pool.map(CallGenerateOutputForConfig, arglists) | 1790 pool.map(CallGenerateOutputForConfig, arglists) |
1793 except KeyboardInterrupt, e: | 1791 except KeyboardInterrupt, e: |
1794 pool.terminate() | 1792 pool.terminate() |
1795 raise e | 1793 raise e |
1796 else: | 1794 else: |
1797 for config_name in config_names: | 1795 for config_name in config_names: |
1798 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1796 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1799 config_name) | 1797 config_name) |
OLD | NEW |