Chromium Code Reviews| Index: pylib/gyp/generator/ninja.py |
| =================================================================== |
| --- pylib/gyp/generator/ninja.py (revision 1746) |
| +++ pylib/gyp/generator/ninja.py (working copy) |
| @@ -2113,7 +2113,33 @@ |
| GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) |
| +def TargetsHaveIOS(targets): |
| + for target_name, target_dict in targets.items(): |
| + for config_name in target_dict['configurations'].keys(): |
|
Nico
2013/10/04 05:11:10
Omit ".keys()", iterating a dict iterates the keys
justincohen
2013/10/04 13:51:52
Done.
|
| + config = target_dict['configurations'][config_name] |
| + settings = config.get('xcode_settings', None) |
|
Nico
2013/10/04 05:11:10
None is the default for get, you can omit it
– bu
justincohen
2013/10/04 13:51:52
Done.
|
| + if settings and settings.get('IPHONEOS_DEPLOYMENT_TARGET', None): |
| + return True |
| + return False |
| + |
| + |
| +def UpdateIOSDeviceConfigurations(targets): |
| + for target_name, target_dict in targets.items(): |
| + for config_name in target_dict['configurations'].keys(): |
| + config = target_dict['configurations'][config_name] |
| + new_config_name = config_name+'-iphoneos' |
|
Nico
2013/10/04 05:11:10
spaces around +
justincohen
2013/10/04 13:51:52
Done.
|
| + new_config_dict = copy.deepcopy(config) |
|
Nico
2013/10/04 05:11:10
How much does this slow down gyp?
justincohen
2013/10/04 13:51:52
For Chrome for iOS, GenerateOutput is called 736 t
|
| + if target_dict['toolset'] == 'target': |
| + new_config_dict['xcode_settings']['ARCHS'] = ['armv7'] |
| + new_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' |
| + target_dict['configurations'][new_config_name] = new_config_dict |
| + return targets |
| + |
| def GenerateOutput(target_list, target_dicts, data, params): |
|
Nico
2013/10/04 05:11:10
call xcode_emulation.CloneConfigurationsForDeviceA
justincohen
2013/10/04 13:51:52
Done.
|
| + # Update target_dicts for iOS device builds. |
| + if TargetsHaveIOS(target_dicts): |
| + target_dicts = UpdateIOSDeviceConfigurations(target_dicts) |
| + |
| user_config = params.get('generator_flags', {}).get('config', None) |
| if gyp.common.GetFlavor(params) == 'win': |
| target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) |