| OLD | NEW |
| 1 # Copyright (c) 2014 Google Inc. All rights reserved. | 1 # Copyright (c) 2014 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 """Xcode-ninja wrapper project file generator. | 5 """Xcode-ninja wrapper project file generator. |
| 6 | 6 |
| 7 This updates the data structures passed to the Xcode gyp generator to build | 7 This updates the data structures passed to the Xcode gyp generator to build |
| 8 with ninja instead. The Xcode project itself is transformed into a list of | 8 with ninja instead. The Xcode project itself is transformed into a list of |
| 9 executable targets, each with a build step to build with ninja, and a target | 9 executable targets, each with a build step to build with ninja, and a target |
| 10 with every source and resource file. This appears to sidestep some of the | 10 with every source and resource file. This appears to sidestep some of the |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 jobs = 0 | 60 jobs = 0 |
| 61 if params: | 61 if params: |
| 62 options = params['options'] | 62 options = params['options'] |
| 63 ninja_toplevel = \ | 63 ninja_toplevel = \ |
| 64 os.path.join(options.toplevel_dir, | 64 os.path.join(options.toplevel_dir, |
| 65 gyp.generator.ninja.ComputeOutputDir(params)) | 65 gyp.generator.ninja.ComputeOutputDir(params)) |
| 66 jobs = params.get('generator_flags', {}).get('xcode_ninja_jobs', 0) | 66 jobs = params.get('generator_flags', {}).get('xcode_ninja_jobs', 0) |
| 67 | 67 |
| 68 target_name = old_spec.get('target_name') | 68 target_name = old_spec.get('target_name') |
| 69 product_name = old_spec.get('product_name', target_name) | 69 product_name = old_spec.get('product_name', target_name) |
| 70 product_extension = old_spec.get('product_extension') |
| 70 | 71 |
| 71 ninja_target = {} | 72 ninja_target = {} |
| 72 ninja_target['target_name'] = target_name | 73 ninja_target['target_name'] = target_name |
| 73 ninja_target['product_name'] = product_name | 74 ninja_target['product_name'] = product_name |
| 75 if product_extension: |
| 76 ninja_target['product_extension'] = product_extension |
| 74 ninja_target['toolset'] = old_spec.get('toolset') | 77 ninja_target['toolset'] = old_spec.get('toolset') |
| 75 ninja_target['default_configuration'] = old_spec.get('default_configuration') | 78 ninja_target['default_configuration'] = old_spec.get('default_configuration') |
| 76 ninja_target['configurations'] = {} | 79 ninja_target['configurations'] = {} |
| 77 | 80 |
| 78 # Tell Xcode to look in |ninja_toplevel| for build products. | 81 # Tell Xcode to look in |ninja_toplevel| for build products. |
| 79 new_xcode_settings = {} | 82 new_xcode_settings = {} |
| 80 if ninja_toplevel: | 83 if ninja_toplevel: |
| 81 new_xcode_settings['CONFIGURATION_BUILD_DIR'] = \ | 84 new_xcode_settings['CONFIGURATION_BUILD_DIR'] = \ |
| 82 "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel | 85 "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel |
| 83 | 86 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 new_data[sources_gyp] = {} | 256 new_data[sources_gyp] = {} |
| 254 new_data[sources_gyp]['targets'] = [] | 257 new_data[sources_gyp]['targets'] = [] |
| 255 new_data[sources_gyp]['included_files'] = [] | 258 new_data[sources_gyp]['included_files'] = [] |
| 256 new_data[sources_gyp]['xcode_settings'] = \ | 259 new_data[sources_gyp]['xcode_settings'] = \ |
| 257 data[orig_gyp].get('xcode_settings', {}) | 260 data[orig_gyp].get('xcode_settings', {}) |
| 258 new_data[sources_gyp]['targets'].append(new_data_target) | 261 new_data[sources_gyp]['targets'].append(new_data_target) |
| 259 | 262 |
| 260 # Write workspace to file. | 263 # Write workspace to file. |
| 261 _WriteWorkspace(main_gyp, sources_gyp, params) | 264 _WriteWorkspace(main_gyp, sources_gyp, params) |
| 262 return (new_target_list, new_target_dicts, new_data) | 265 return (new_target_list, new_target_dicts, new_data) |
| OLD | NEW |