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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 self.is_standalone_static_library = bool( | 371 self.is_standalone_static_library = bool( |
372 spec.get('standalone_static_library', 0)) | 372 spec.get('standalone_static_library', 0)) |
373 | 373 |
374 self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) | 374 self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) |
375 self.xcode_settings = self.msvs_settings = None | 375 self.xcode_settings = self.msvs_settings = None |
376 if self.flavor == 'mac': | 376 if self.flavor == 'mac': |
377 self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) | 377 self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) |
378 if self.flavor == 'win': | 378 if self.flavor == 'win': |
379 self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, | 379 self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, |
380 generator_flags) | 380 generator_flags) |
381 target_platform = self.msvs_settings.GetTargetPlatform(config_name) | 381 arch = self.msvs_settings.GetArch(config_name) |
382 self.ninja.variable('arch', self.win_env[target_platform]) | 382 self.ninja.variable('arch', self.win_env[arch]) |
383 | 383 |
384 # Compute predepends for all rules. | 384 # Compute predepends for all rules. |
385 # actions_depends is the dependencies this target depends on before running | 385 # actions_depends is the dependencies this target depends on before running |
386 # any of its action/rule/copy steps. | 386 # any of its action/rule/copy steps. |
387 # compile_depends is the dependencies this target depends on before running | 387 # compile_depends is the dependencies this target depends on before running |
388 # any of its compile steps. | 388 # any of its compile steps. |
389 actions_depends = [] | 389 actions_depends = [] |
390 compile_depends = [] | 390 compile_depends = [] |
391 # TODO(evan): it is rather confusing which things are lists and which | 391 # TODO(evan): it is rather confusing which things are lists and which |
392 # are strings. Fix these. | 392 # are strings. Fix these. |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
801 self.msvs_settings.GetTargetPlatform(config_name) == 'Win32'): | 801 self.msvs_settings.GetArch(config_name) == 'x86'): |
802 # Asm files only get auto assembled for x86 (not x64). | 802 # Asm files only get auto assembled for x86 (not x64). |
803 command = 'asm' | 803 command = 'asm' |
804 # Add the _asm suffix as msvs is capable of handling .cc and | 804 # Add the _asm suffix as msvs is capable of handling .cc and |
805 # .asm files of the same name without collision. | 805 # .asm files of the same name without collision. |
806 obj_ext = '_asm.obj' | 806 obj_ext = '_asm.obj' |
807 elif self.flavor == 'mac' and ext == 'm': | 807 elif self.flavor == 'mac' and ext == 'm': |
808 command = 'objc' | 808 command = 'objc' |
809 elif self.flavor == 'mac' and ext == 'mm': | 809 elif self.flavor == 'mac' and ext == 'mm': |
810 command = 'objcxx' | 810 command = 'objcxx' |
811 elif self.flavor == 'win' and ext == 'rc': | 811 elif self.flavor == 'win' and ext == 'rc': |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 arglists.append( | 1789 arglists.append( |
1790 (target_list, target_dicts, data, params, config_name)) | 1790 (target_list, target_dicts, data, params, config_name)) |
1791 pool.map(CallGenerateOutputForConfig, arglists) | 1791 pool.map(CallGenerateOutputForConfig, arglists) |
1792 except KeyboardInterrupt, e: | 1792 except KeyboardInterrupt, e: |
1793 pool.terminate() | 1793 pool.terminate() |
1794 raise e | 1794 raise e |
1795 else: | 1795 else: |
1796 for config_name in config_names: | 1796 for config_name in config_names: |
1797 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1797 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1798 config_name) | 1798 config_name) |
OLD | NEW |