| OLD | NEW |
| 1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 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 collections |
| 5 import copy | 6 import copy |
| 6 import hashlib | 7 import hashlib |
| 7 import json | 8 import json |
| 8 import multiprocessing | 9 import multiprocessing |
| 9 import os.path | 10 import os.path |
| 10 import re | 11 import re |
| 11 import signal | 12 import signal |
| 12 import subprocess | 13 import subprocess |
| 13 import sys | 14 import sys |
| 14 import gyp | 15 import gyp |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 self.ninja, config_name, config, sources, compile_depends_stamp, pch, | 466 self.ninja, config_name, config, sources, compile_depends_stamp, pch, |
| 466 spec) | 467 spec) |
| 467 # Some actions/rules output 'sources' that are already object files. | 468 # Some actions/rules output 'sources' that are already object files. |
| 468 obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] | 469 obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] |
| 469 if obj_outputs: | 470 if obj_outputs: |
| 470 if self.flavor != 'mac' or len(self.archs) == 1: | 471 if self.flavor != 'mac' or len(self.archs) == 1: |
| 471 link_deps += [self.GypPathToNinja(o) for o in obj_outputs] | 472 link_deps += [self.GypPathToNinja(o) for o in obj_outputs] |
| 472 else: | 473 else: |
| 473 print "Warning: Actions/rules writing object files don't work with " \ | 474 print "Warning: Actions/rules writing object files don't work with " \ |
| 474 "multiarch targets, dropping. (target %s)" % spec['target_name'] | 475 "multiarch targets, dropping. (target %s)" % spec['target_name'] |
| 476 elif self.flavor == 'mac' and len(self.archs) > 1: |
| 477 link_deps = collections.defaultdict(list) |
| 475 | 478 |
| 476 | 479 |
| 477 if self.flavor == 'win' and self.target.type == 'static_library': | 480 if self.flavor == 'win' and self.target.type == 'static_library': |
| 478 self.target.component_objs = link_deps | 481 self.target.component_objs = link_deps |
| 479 | 482 |
| 480 # Write out a link step, if needed. | 483 # Write out a link step, if needed. |
| 481 output = None | 484 output = None |
| 482 is_empty_bundle = not link_deps and not mac_bundle_depends | 485 is_empty_bundle = not link_deps and not mac_bundle_depends |
| 483 if link_deps or self.target.actions_stamp or actions_depends: | 486 if link_deps or self.target.actions_stamp or actions_depends: |
| 484 output = self.WriteTarget(spec, config_name, config, link_deps, | 487 output = self.WriteTarget(spec, config_name, config, link_deps, |
| (...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 arglists.append( | 2151 arglists.append( |
| 2149 (target_list, target_dicts, data, params, config_name)) | 2152 (target_list, target_dicts, data, params, config_name)) |
| 2150 pool.map(CallGenerateOutputForConfig, arglists) | 2153 pool.map(CallGenerateOutputForConfig, arglists) |
| 2151 except KeyboardInterrupt, e: | 2154 except KeyboardInterrupt, e: |
| 2152 pool.terminate() | 2155 pool.terminate() |
| 2153 raise e | 2156 raise e |
| 2154 else: | 2157 else: |
| 2155 for config_name in config_names: | 2158 for config_name in config_names: |
| 2156 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2159 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 2157 config_name) | 2160 config_name) |
| OLD | NEW |