@@ -237,7 +237,11 @@ def GetExtension(self):
237
237
def GetVSMacroEnv (self , base_to_build = None , config = None ):
238
238
"""Get a dict of variables mapping internal VS macro names to their gyp
239
239
equivalents."""
240
- target_platform = 'Win32' if self .GetArch (config ) == 'x86' else 'x64'
240
+ target_arch = self .GetArch (config )
241
+ if target_arch == 'x86' :
242
+ target_platform = 'Win32'
243
+ else :
244
+ target_platform = target_arch
241
245
target_name = self .spec .get ('product_prefix' , '' ) + \
242
246
self .spec .get ('product_name' , self .spec ['target_name' ])
243
247
target_dir = base_to_build + '\\ ' if base_to_build else ''
@@ -299,7 +303,7 @@ def GetArch(self, config):
299
303
if not platform : # If no specific override, use the configuration's.
300
304
platform = configuration_platform
301
305
# Map from platform to architecture.
302
- return {'Win32' : 'x86' , 'x64' : 'x64' }.get (platform , 'x86' )
306
+ return {'Win32' : 'x86' , 'x64' : 'x64' , 'ARM64' : 'arm64' }.get (platform , 'x86' )
303
307
304
308
def _TargetConfig (self , config ):
305
309
"""Returns the target-specific configuration."""
@@ -563,7 +567,10 @@ def GetLdflags(self, config, gyp_to_build_path, expand_special,
563
567
'VCLinkerTool' , append = ldflags )
564
568
self ._GetDefFileAsLdflags (ldflags , gyp_to_build_path )
565
569
ld ('GenerateDebugInformation' , map = {'true' : '/DEBUG' })
566
- ld ('TargetMachine' , map = {'1' : 'X86' , '17' : 'X64' , '3' : 'ARM' },
570
+ # TODO: These 'map' values come from machineTypeOption enum,
571
+ # and does not have an official value for ARM64 in VS2017 (yet).
572
+ # It needs to verify the ARM64 value when machineTypeOption is updated.
573
+ ld ('TargetMachine' , map = {'1' : 'X86' , '17' : 'X64' , '3' : 'ARM' , '18' : 'ARM64' },
567
574
prefix = '/MACHINE:' )
568
575
ldflags .extend (self ._GetAdditionalLibraryDirectories (
569
576
'VCLinkerTool' , config , gyp_to_build_path ))
@@ -860,7 +867,9 @@ def midl(name, default=None):
860
867
('iid' , iid ),
861
868
('proxy' , proxy )]
862
869
# TODO(scottmg): Are there configuration settings to set these flags?
863
- target_platform = 'win32' if self .GetArch (config ) == 'x86' else 'x64'
870
+ target_platform = self .GetArch (config )
871
+ if target_platform == 'x86' :
872
+ target_platform = 'win32'
864
873
flags = ['/char' , 'signed' , '/env' , target_platform , '/Oicf' ]
865
874
return outdir , output , variables , flags
866
875
0 commit comments