Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1050)

Side by Side Diff: pylib/gyp/generator/ninja.py

Issue 25355002: ninja/mac: Create -iphoneos device builds for iOS ninja generator. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Rebaase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/ios/app-bundle/test-device.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 copy 5 import copy
6 import hashlib 6 import hashlib
7 import multiprocessing 7 import multiprocessing
8 import os.path 8 import os.path
9 import re 9 import re
10 import signal 10 import signal
(...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after
2106 2106
2107 def CallGenerateOutputForConfig(arglist): 2107 def CallGenerateOutputForConfig(arglist):
2108 # Ignore the interrupt signal so that the parent process catches it and 2108 # Ignore the interrupt signal so that the parent process catches it and
2109 # kills all multiprocessing children. 2109 # kills all multiprocessing children.
2110 signal.signal(signal.SIGINT, signal.SIG_IGN) 2110 signal.signal(signal.SIGINT, signal.SIG_IGN)
2111 2111
2112 (target_list, target_dicts, data, params, config_name) = arglist 2112 (target_list, target_dicts, data, params, config_name) = arglist
2113 GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) 2113 GenerateOutputForConfig(target_list, target_dicts, data, params, config_name)
2114 2114
2115 2115
2116 def TargetsHaveIOS(targets):
2117 for target_name, target_dict in targets.items():
2118 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.
2119 config = target_dict['configurations'][config_name]
2120 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.
2121 if settings and settings.get('IPHONEOS_DEPLOYMENT_TARGET', None):
2122 return True
2123 return False
2124
2125
2126 def UpdateIOSDeviceConfigurations(targets):
2127 for target_name, target_dict in targets.items():
2128 for config_name in target_dict['configurations'].keys():
2129 config = target_dict['configurations'][config_name]
2130 new_config_name = config_name+'-iphoneos'
Nico 2013/10/04 05:11:10 spaces around +
justincohen 2013/10/04 13:51:52 Done.
2131 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
2132 if target_dict['toolset'] == 'target':
2133 new_config_dict['xcode_settings']['ARCHS'] = ['armv7']
2134 new_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos'
2135 target_dict['configurations'][new_config_name] = new_config_dict
2136 return targets
2137
2116 def GenerateOutput(target_list, target_dicts, data, params): 2138 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.
2139 # Update target_dicts for iOS device builds.
2140 if TargetsHaveIOS(target_dicts):
2141 target_dicts = UpdateIOSDeviceConfigurations(target_dicts)
2142
2117 user_config = params.get('generator_flags', {}).get('config', None) 2143 user_config = params.get('generator_flags', {}).get('config', None)
2118 if gyp.common.GetFlavor(params) == 'win': 2144 if gyp.common.GetFlavor(params) == 'win':
2119 target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) 2145 target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts)
2120 target_list, target_dicts = MSVSUtil.InsertLargePdbShims( 2146 target_list, target_dicts = MSVSUtil.InsertLargePdbShims(
2121 target_list, target_dicts, generator_default_variables) 2147 target_list, target_dicts, generator_default_variables)
2122 2148
2123 if user_config: 2149 if user_config:
2124 GenerateOutputForConfig(target_list, target_dicts, data, params, 2150 GenerateOutputForConfig(target_list, target_dicts, data, params,
2125 user_config) 2151 user_config)
2126 else: 2152 else:
2127 config_names = target_dicts[target_list[0]]['configurations'].keys() 2153 config_names = target_dicts[target_list[0]]['configurations'].keys()
2128 if params['parallel']: 2154 if params['parallel']:
2129 try: 2155 try:
2130 pool = multiprocessing.Pool(len(config_names)) 2156 pool = multiprocessing.Pool(len(config_names))
2131 arglists = [] 2157 arglists = []
2132 for config_name in config_names: 2158 for config_name in config_names:
2133 arglists.append( 2159 arglists.append(
2134 (target_list, target_dicts, data, params, config_name)) 2160 (target_list, target_dicts, data, params, config_name))
2135 pool.map(CallGenerateOutputForConfig, arglists) 2161 pool.map(CallGenerateOutputForConfig, arglists)
2136 except KeyboardInterrupt, e: 2162 except KeyboardInterrupt, e:
2137 pool.terminate() 2163 pool.terminate()
2138 raise e 2164 raise e
2139 else: 2165 else:
2140 for config_name in config_names: 2166 for config_name in config_names:
2141 GenerateOutputForConfig(target_list, target_dicts, data, params, 2167 GenerateOutputForConfig(target_list, target_dicts, data, params,
2142 config_name) 2168 config_name)
OLDNEW
« no previous file with comments | « no previous file | test/ios/app-bundle/test-device.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698