Chromium Code Reviews| 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 filecmp | 5 import filecmp |
| 6 import gyp.common | 6 import gyp.common |
| 7 import gyp.xcodeproj_file | 7 import gyp.xcodeproj_file |
| 8 import gyp.xcode_ninja | 8 import gyp.xcode_ninja |
| 9 import errno | 9 import errno |
| 10 import os | 10 import os |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 'xcode_create_dependents_test_runner', | 80 'xcode_create_dependents_test_runner', |
| 81 ] | 81 ] |
| 82 | 82 |
| 83 # We want to let any rules apply to files that are resources also. | 83 # We want to let any rules apply to files that are resources also. |
| 84 generator_extra_sources_for_rules = [ | 84 generator_extra_sources_for_rules = [ |
| 85 'mac_bundle_resources', | 85 'mac_bundle_resources', |
| 86 'mac_framework_headers', | 86 'mac_framework_headers', |
| 87 'mac_framework_private_headers', | 87 'mac_framework_private_headers', |
| 88 ] | 88 ] |
| 89 | 89 |
| 90 generator_filelist_paths = None | |
| 91 | |
| 90 # Xcode's standard set of library directories, which don't need to be duplicated | 92 # Xcode's standard set of library directories, which don't need to be duplicated |
| 91 # in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay. | 93 # in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay. |
| 92 xcode_standard_library_dirs = frozenset([ | 94 xcode_standard_library_dirs = frozenset([ |
| 93 '$(SDKROOT)/usr/lib', | 95 '$(SDKROOT)/usr/lib', |
| 94 '$(SDKROOT)/usr/local/lib', | 96 '$(SDKROOT)/usr/local/lib', |
| 95 ]) | 97 ]) |
| 96 | 98 |
| 97 def CreateXCConfigurationList(configuration_names): | 99 def CreateXCConfigurationList(configuration_names): |
| 98 xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []}) | 100 xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []}) |
| 99 if len(configuration_names) == 0: | 101 if len(configuration_names) == 0: |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 571 if options.generator_output: | 573 if options.generator_output: |
| 572 xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) | 574 xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) |
| 573 | 575 |
| 574 for config in configurations: | 576 for config in configurations: |
| 575 arguments = ['xcodebuild', '-project', xcodeproj_path] | 577 arguments = ['xcodebuild', '-project', xcodeproj_path] |
| 576 arguments += ['-configuration', config] | 578 arguments += ['-configuration', config] |
| 577 print "Building [%s]: %s" % (config, arguments) | 579 print "Building [%s]: %s" % (config, arguments) |
| 578 subprocess.check_call(arguments) | 580 subprocess.check_call(arguments) |
| 579 | 581 |
| 580 | 582 |
| 583 def CalculateGeneratorInputInfo(params): | |
| 584 toplevel = params['options'].toplevel_dir | |
| 585 if params.get('flavor') == 'ninja': | |
| 586 generator_dir = os.path.relpath(params['options'].generator_output or '.') | |
| 587 output_dir = params.get('generator_flags', {}).get('output_dir', 'out') | |
| 588 output_dir = os.path.normpath(os.path.join(generator_dir, output_dir)) | |
| 589 qualified_out_dir = os.path.normpath(os.path.join( | |
| 590 toplevel, output_dir, 'gypfiles-xcode-ninja')) | |
| 591 else: | |
| 592 output_dir = os.path.normpath(os.path.join(toplevel, 'xcodebuild')) | |
|
Mark Mentovai
2015/11/30 14:22:53
Can you not hardcode xcodebuild? This is not the d
| |
| 593 qualified_out_dir = os.path.normpath(os.path.join( | |
| 594 toplevel, output_dir, 'gypfiles')) | |
| 595 | |
| 596 global generator_filelist_paths | |
| 597 generator_filelist_paths = { | |
| 598 'toplevel': toplevel, | |
| 599 'qualified_out_dir': qualified_out_dir, | |
| 600 } | |
| 601 | |
| 602 | |
| 581 def GenerateOutput(target_list, target_dicts, data, params): | 603 def GenerateOutput(target_list, target_dicts, data, params): |
| 582 # Optionally configure each spec to use ninja as the external builder. | 604 # Optionally configure each spec to use ninja as the external builder. |
| 583 ninja_wrapper = params.get('flavor') == 'ninja' | 605 ninja_wrapper = params.get('flavor') == 'ninja' |
| 584 if ninja_wrapper: | 606 if ninja_wrapper: |
| 585 (target_list, target_dicts, data) = \ | 607 (target_list, target_dicts, data) = \ |
| 586 gyp.xcode_ninja.CreateWrapper(target_list, target_dicts, data, params) | 608 gyp.xcode_ninja.CreateWrapper(target_list, target_dicts, data, params) |
| 587 | 609 |
| 588 options = params['options'] | 610 options = params['options'] |
| 589 generator_flags = params.get('generator_flags', {}) | 611 generator_flags = params.get('generator_flags', {}) |
| 590 parallel_builds = generator_flags.get('xcode_parallel_builds', True) | 612 parallel_builds = generator_flags.get('xcode_parallel_builds', True) |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1269 | 1291 |
| 1270 for build_file in build_files: | 1292 for build_file in build_files: |
| 1271 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) | 1293 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) |
| 1272 | 1294 |
| 1273 for build_file in build_files: | 1295 for build_file in build_files: |
| 1274 xcode_projects[build_file].Finalize2(xcode_targets, | 1296 xcode_projects[build_file].Finalize2(xcode_targets, |
| 1275 xcode_target_to_target_dict) | 1297 xcode_target_to_target_dict) |
| 1276 | 1298 |
| 1277 for build_file in build_files: | 1299 for build_file in build_files: |
| 1278 xcode_projects[build_file].Write() | 1300 xcode_projects[build_file].Write() |
| OLD | NEW |