@@ -97,7 +97,7 @@ def create_directory(path):
97
97
98
98
99
99
class DumpConfig :
100
- def __init__ (self , tool_path , platform ):
100
+ def __init__ (self , tool_path , platform , platform_alias ):
101
101
target_map = {
102
102
'iphoneos' : 'arm64-apple-ios13.0' ,
103
103
'macosx' : 'x86_64-apple-macosx10.15' ,
@@ -110,12 +110,11 @@ def __init__(self, tool_path, platform):
110
110
self .target = target_map [platform ]
111
111
self .sdk = get_sdk_path (platform )
112
112
self .inputs = []
113
+ self .platform_alias = platform_alias
113
114
if self .platform == 'macosx' :
114
115
# We need this input search path for CreateML
115
116
self .inputs .extend ([self .sdk + '/usr/lib/swift/' ])
116
- self .frameworks = [
117
- self .sdk + '/System/Library/Frameworks/' ,
118
- os .path .realpath (self .sdk + '/../../Library/Frameworks/' )]
117
+ self .frameworks = []
119
118
if self .platform .startswith ('iosmac' ):
120
119
# Catalyst modules need this extra framework dir
121
120
iOSSupport = self .sdk + \
@@ -156,7 +155,8 @@ def run(self, output, module, swift_ver, opts, verbose,
156
155
continue
157
156
dir_path = os .path .realpath (output + '/' + module )
158
157
file_path = os .path .realpath (dir_path + '/' +
159
- self .platform + '.json' )
158
+ self .platform_alias +
159
+ '.json' )
160
160
create_directory (dir_path )
161
161
current_cmd = list (cmd )
162
162
current_cmd .extend (['-module' , module ])
@@ -245,6 +245,12 @@ def main():
245
245
action = 'store_true' ,
246
246
help = 'When importing entire SDK, dump content '
247
247
'seprately by module names' )
248
+
249
+ basic_group .add_argument ('--platform-alias' , default = '' , help = '''
250
+ Specify a file name to use if using a platform name in json file isn't
251
+ optimal
252
+ ''' )
253
+
248
254
args = parser .parse_args (sys .argv [1 :])
249
255
250
256
if args .action == 'dump' :
@@ -263,7 +269,10 @@ def main():
263
269
include_fixed_clang_modules = False
264
270
else :
265
271
fatal_error ("cannot recognize --module-filter" )
266
- runner = DumpConfig (tool_path = args .tool_path , platform = args .target )
272
+ if args .platform_alias == '' :
273
+ args .platform_alias = args .target
274
+ runner = DumpConfig (tool_path = args .tool_path , platform = args .target ,
275
+ platform_alias = args .platform_alias )
267
276
runner .run (output = args .output , module = args .module ,
268
277
swift_ver = args .swift_version , opts = args .opts ,
269
278
verbose = args .v ,
0 commit comments