Commit feb9a5e3 authored by Luke Macken's avatar Luke Macken

Get the windows build script working with my VS 2008 install

parent ec338a68
...@@ -8,10 +8,17 @@ def compile(filename, outputfilename, arch='x86', vcver=None): ...@@ -8,10 +8,17 @@ def compile(filename, outputfilename, arch='x86', vcver=None):
vcver = float(os.getenv('MSVCVER')) vcver = float(os.getenv('MSVCVER'))
else: else:
vcver = msvc9compiler.get_build_version() vcver = msvc9compiler.get_build_version()
vcvarsall = msvc9compiler.find_vcvarsall(vcver) vcvars = msvc9compiler.find_vcvarsall(vcver)
if not vcvars: # My VS 2008 Standard Edition doesn't have vcvarsall.bat
vsbase = msvc9compiler.VS_BASE % vcver
productdir = msvc9compiler.Reg.get_value(r"%s\Setup\VC" % vsbase,
"productdir")
bat = 'vcvars%d.bat' % (arch == 'x86' and 32 or 64)
vcvars = os.path.join(productdir, 'bin', bat)
path = os.path.splitext(outputfilename) path = os.path.splitext(outputfilename)
objfilename = path[0] + '.obj' objfilename = path[0] + '.obj'
p = subprocess.Popen('"%s" %s & cl %s /Fe%s /Fo%s' % (vcvarsall, arch, filename, outputfilename, objfilename), p = subprocess.Popen('"%s" %s & cl %s /Fe%s /Fo%s' % (vcvars, arch, filename, outputfilename, objfilename),
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment