@@ -89,7 +89,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) {
8989 const host = vars [ 'VSCMD_ARG_HOST_ARCH' ] ;
9090 const target = vars [ 'VSCMD_ARG_TGT_ARCH' ] ;
9191 const arch = vcvars . getArchitecture ( {
92- host : match ( host , { 'x86' : 'x86' , 'x64' : 'x64' } ) ?? 'x64' ,
92+ host : match ( host , { 'x86' : 'x86' , 'x64' : 'x64' , 'arm64' : 'arm64' } ) ?? 'x64' ,
9393 target : match ( target , { 'x86' : 'x86' , 'x64' : 'x64' , 'arm64' : 'ARM64' , 'arm' : 'ARM' } ) ?? 'x64'
9494 } ) ;
9595 const settings = new CppSettings ( ) ;
@@ -109,7 +109,8 @@ async function getVSInstallations() {
109109 all : true ,
110110 prerelease : true ,
111111 sort : true ,
112- requires : [ 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' ]
112+ requires : [ 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' , 'Microsoft.VisualStudio.Component.VC.Tools.ARM64' ] ,
113+ requiresAny : true
113114 } ) ;
114115
115116 if ( installations . length === 0 ) {
@@ -217,9 +218,9 @@ async function getHostsAndTargets(vcPath: string): Promise<vcvars.HostTarget[]>
217218 }
218219 const hostTargets : vcvars . HostTarget [ ] = [ ] ;
219220 for ( const host of hosts ) {
220- const h = match < 'x86' | 'x64' | undefined > ( host . toLowerCase ( ) , { 'hostx86' : 'x86' , 'hostx64' : 'x64' } ) ;
221+ const h = match < 'x86' | 'x64' | 'arm64' | undefined > ( host . toLowerCase ( ) , { 'hostx86' : 'x86' , 'hostx64' : 'x64' , 'hostarm64' : 'arm64 ' } ) ;
221222 if ( ! h ) {
222- // skip any arm/arm64 folders because there is no arm compiler
223+ // skip any non-matching folders
223224 continue ;
224225 }
225226 const targets = await fs . readdir ( path . join ( vcPath , host ) ) ;
0 commit comments