Skip to content

Commit

Permalink
attempt to fix appveyor by using default paths to vcvarsall.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
ndjensen committed Aug 10, 2021
1 parent d4abd75 commit 6367d1a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion commands/msvc9compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
from distutils import msvc9compiler as old_msvc_module
from distutils.msvc9compiler import MSVCCompiler as old_MSVCCompiler

VCVARSALL_LOCATIONS = (
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat",
"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat"
)


class MSVCCompiler(old_MSVCCompiler):

Expand Down Expand Up @@ -75,6 +81,11 @@ def manifest_setup_ldargs(self, output_filename, build_temp, ld_args):


def find_vcvarsall(version):
import os
for loc in VCVARSALL_LOCATIONS:
if os.path.isfile(loc):
return loc

Reg = distutils.msvc9compiler.Reg
VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f'
key = VC_BASE % ('', version)
Expand All @@ -90,7 +101,6 @@ def find_vcvarsall(version):
productdir = None

if productdir:
import os
vcvarsall = os.path.join(productdir, "vcvarsall.bat")
if os.path.isfile(vcvarsall):
return vcvarsall
Expand Down

0 comments on commit 6367d1a

Please sign in to comment.