File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -166,12 +166,16 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64
166166:vs-set-2017 
167167if  " %target_env% " NEQ  " vs2017" goto  vs-set-2015
168168echo  Looking for Visual Studio 2017 
169- if  " _%VSCMD_ARG_TGT_ARCH% _" == " _%target_arch% _" goto  found_vs2017
169+ @ rem  check if VS2017 is already setup, and for the requested arch
170+ if  " _%VisualStudioVersion% _" ==  " _15.0_" if  " _%VSCMD_ARG_TGT_ARCH% _" == " _%target_arch% _" goto  found_vs2017
171+ set  " VSINSTALLDIR = " 
170172call  tools\msvs\vswhere_usability_wrapper.cmd
171173if  " _%VCINSTALLDIR% _" ==  " __" goto  vs-set-2015
174+ @ rem  need to clear VSINSTALLDIR for vcvarsall to work as expected
172175set  vcvars_call = " %VCINSTALLDIR% \Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg% 
173176echo  calling: %vcvars_call% 
174177call  %vcvars_call% 
178+ 
175179:found_vs2017 
176180echo  Found MSVS version %VisualStudioVersion% 
177181set  GYP_MSVS_VERSION = 2017 
@@ -193,10 +197,9 @@ if defined msi (
193197    goto  wix-not-found
194198  )
195199)
196- if  " %VCVARS_VER% " NEQ  " 140" 
197-   call  " %VS140COMNTOOLS% \..\..\vc\vcvarsall.bat" 
198-   SET  VCVARS_VER = 140 
199- )
200+ @ rem  VS2015 vsvarsall is quick, so run anyway
201+ call  " %VS140COMNTOOLS% \..\..\vc\vcvarsall.bat" 
202+ SET  VCVARS_VER = 140 
200203if  not  defined  VCINSTALLDIR goto  msbuild-not-found
201204set  GYP_MSVS_VERSION = 2015 
202205set  PLATFORM_TOOLSET = v140
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments