| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 import filecmp | 3 import filecmp |
| 4 import gyp.common | 4 import gyp.common |
| 5 import gyp.xcodeproj_file | 5 import gyp.xcodeproj_file |
| 6 import errno | 6 import errno |
| 7 import os | 7 import os |
| 8 import posixpath | 8 import posixpath |
| 9 import re | 9 import re |
| 10 import shutil | 10 import shutil |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 # does the it define it's own "all"? | 166 # does the it define it's own "all"? |
| 167 has_custom_all = False | 167 has_custom_all = False |
| 168 | 168 |
| 169 # targets_for_all is the list of ordinary_targets that should be listed | 169 # targets_for_all is the list of ordinary_targets that should be listed |
| 170 # in this project's "All" target. It includes each non_runtest_target | 170 # in this project's "All" target. It includes each non_runtest_target |
| 171 # that does not have suppress_wildcard set. | 171 # that does not have suppress_wildcard set. |
| 172 targets_for_all = [] | 172 targets_for_all = [] |
| 173 | 173 |
| 174 for target in self.build_file_dict['targets']: | 174 for target in self.build_file_dict['targets']: |
| 175 target_name = target['target_name'] | 175 target_name = target['target_name'] |
| 176 qualified_target = gyp.common.QualifiedTarget(self.gyp_path, target_name) | 176 toolset = target['toolset'] |
| 177 qualified_target = gyp.common.QualifiedTarget(self.gyp_path, target_name, |
| 178 toolset) |
| 177 xcode_target = xcode_targets[qualified_target] | 179 xcode_target = xcode_targets[qualified_target] |
| 178 # Make sure that the target being added to the sorted list is already in | 180 # Make sure that the target being added to the sorted list is already in |
| 179 # the unsorted list. | 181 # the unsorted list. |
| 180 assert xcode_target in self.project._properties['targets'] | 182 assert xcode_target in self.project._properties['targets'] |
| 181 targets.append(xcode_target) | 183 targets.append(xcode_target) |
| 182 ordinary_targets.append(xcode_target) | 184 ordinary_targets.append(xcode_target) |
| 183 | 185 |
| 184 if not target.get('suppress_wildcard', False): | 186 if not target.get('suppress_wildcard', False): |
| 185 targets_for_all.append(xcode_target) | 187 targets_for_all.append(xcode_target) |
| 186 | 188 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 # these references. | 325 # these references. |
| 324 | 326 |
| 325 # To support making a "test runner" target that will run all the tests | 327 # To support making a "test runner" target that will run all the tests |
| 326 # that are direct dependents of any given target, we look for | 328 # that are direct dependents of any given target, we look for |
| 327 # xcode_create_dependents_test_runner being set on an Aggregate target, | 329 # xcode_create_dependents_test_runner being set on an Aggregate target, |
| 328 # and generate a second target that will run the tests found under the | 330 # and generate a second target that will run the tests found under the |
| 329 # marked target. | 331 # marked target. |
| 330 for bf_tgt in self.build_file_dict['targets']: | 332 for bf_tgt in self.build_file_dict['targets']: |
| 331 if int(bf_tgt.get('xcode_create_dependents_test_runner', 0)): | 333 if int(bf_tgt.get('xcode_create_dependents_test_runner', 0)): |
| 332 tgt_name = bf_tgt['target_name'] | 334 tgt_name = bf_tgt['target_name'] |
| 335 toolset = bf_tgt['toolset'] |
| 333 qualified_target = gyp.common.QualifiedTarget(self.gyp_path, | 336 qualified_target = gyp.common.QualifiedTarget(self.gyp_path, |
| 334 tgt_name) | 337 tgt_name, toolset) |
| 335 xcode_target = xcode_targets[qualified_target] | 338 xcode_target = xcode_targets[qualified_target] |
| 336 if isinstance(xcode_target, gyp.xcodeproj_file.PBXAggregateTarget): | 339 if isinstance(xcode_target, gyp.xcodeproj_file.PBXAggregateTarget): |
| 337 # Collect all the test targets. | 340 # Collect all the test targets. |
| 338 all_tests = [] | 341 all_tests = [] |
| 339 pbxtds = xcode_target.GetProperty('dependencies') | 342 pbxtds = xcode_target.GetProperty('dependencies') |
| 340 for pbxtd in pbxtds: | 343 for pbxtd in pbxtds: |
| 341 pbxcip = pbxtd.GetProperty('targetProxy') | 344 pbxcip = pbxtd.GetProperty('targetProxy') |
| 342 dependency_xct = pbxcip.GetProperty('remoteGlobalIDString') | 345 dependency_xct = pbxcip.GetProperty('remoteGlobalIDString') |
| 343 target_dict = xcode_target_to_target_dict[dependency_xct] | 346 target_dict = xcode_target_to_target_dict[dependency_xct] |
| 344 if target_dict and int(target_dict.get('test', 0)): | 347 if target_dict and int(target_dict.get('test', 0)): |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 566 |
| 564 main_group = pbxp.GetProperty('mainGroup') | 567 main_group = pbxp.GetProperty('mainGroup') |
| 565 build_group = gyp.xcodeproj_file.PBXGroup({'name': 'Build'}) | 568 build_group = gyp.xcodeproj_file.PBXGroup({'name': 'Build'}) |
| 566 main_group.AppendChild(build_group) | 569 main_group.AppendChild(build_group) |
| 567 for included_file in build_file_dict['included_files']: | 570 for included_file in build_file_dict['included_files']: |
| 568 build_group.AddOrGetFileByPath(included_file, False) | 571 build_group.AddOrGetFileByPath(included_file, False) |
| 569 | 572 |
| 570 xcode_targets = {} | 573 xcode_targets = {} |
| 571 xcode_target_to_target_dict = {} | 574 xcode_target_to_target_dict = {} |
| 572 for qualified_target in target_list: | 575 for qualified_target in target_list: |
| 573 [build_file, target_name] = \ | 576 [build_file, target_name, toolset] = \ |
| 574 gyp.common.BuildFileAndTarget('', qualified_target)[0:2] | 577 gyp.common.ParseQualifiedTarget(qualified_target) |
| 578 |
| 575 spec = target_dicts[qualified_target] | 579 spec = target_dicts[qualified_target] |
| 580 if spec['toolset'] != 'target': |
| 581 raise Exception( |
| 582 'Multiple toolsets not supported in xcode build (target %s)' % |
| 583 qualified_target) |
| 576 configuration_names = [spec['default_configuration']] | 584 configuration_names = [spec['default_configuration']] |
| 577 for configuration_name in sorted(spec['configurations'].keys()): | 585 for configuration_name in sorted(spec['configurations'].keys()): |
| 578 if configuration_name not in configuration_names: | 586 if configuration_name not in configuration_names: |
| 579 configuration_names.append(configuration_name) | 587 configuration_names.append(configuration_name) |
| 580 xcp = xcode_projects[build_file] | 588 xcp = xcode_projects[build_file] |
| 581 pbxp = xcp.project | 589 pbxp = xcp.project |
| 582 | 590 |
| 583 # Set up the configurations for the target according to the list of names | 591 # Set up the configurations for the target according to the list of names |
| 584 # supplied. | 592 # supplied. |
| 585 xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []}) | 593 xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []}) |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 | 1094 |
| 1087 for build_file in build_files: | 1095 for build_file in build_files: |
| 1088 xcode_projects[build_file].Finalize1(xcode_targets) | 1096 xcode_projects[build_file].Finalize1(xcode_targets) |
| 1089 | 1097 |
| 1090 for build_file in build_files: | 1098 for build_file in build_files: |
| 1091 xcode_projects[build_file].Finalize2(xcode_targets, | 1099 xcode_projects[build_file].Finalize2(xcode_targets, |
| 1092 xcode_target_to_target_dict) | 1100 xcode_target_to_target_dict) |
| 1093 | 1101 |
| 1094 for build_file in build_files: | 1102 for build_file in build_files: |
| 1095 xcode_projects[build_file].Write() | 1103 xcode_projects[build_file].Write() |
| OLD | NEW |