[pypy-commit] pypy default: cleanup, enable VSXXXCOMNTOOLS in win32 platform

mattip pypy.commits at gmail.com
Tue Nov 28 08:35:26 EST 2017


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r93189:1351a1844107
Date: 2017-11-28 15:33 +0200
http://bitbucket.org/pypy/pypy/changeset/1351a1844107/

Log:	cleanup, enable VSXXXCOMNTOOLS in win32 platform

diff --git a/rpython/translator/platform/windows.py b/rpython/translator/platform/windows.py
--- a/rpython/translator/platform/windows.py
+++ b/rpython/translator/platform/windows.py
@@ -10,21 +10,13 @@
 rpydir = str(py.path.local(rpython.__file__).join('..'))
 
 def _get_compiler_type(cc, x64_flag):
-    import subprocess
     if not cc:
         cc = os.environ.get('CC','')
     if not cc:
         return MsvcPlatform(x64=x64_flag)
     elif cc.startswith('mingw') or cc == 'gcc':
         return MingwPlatform(cc)
-    else:
-        return MsvcPlatform(cc=cc, x64=x64_flag)
-    try:
-        subprocess.check_output([cc, '--version'])
-    except:
-        raise ValueError("Could not find compiler specified by cc option '%s',"
-                         " it must be a valid exe file on your path" % cc)
-    return MingwPlatform(cc)
+    return MsvcPlatform(cc=cc, x64=x64_flag)
 
 def Windows(cc=None):
     return _get_compiler_type(cc, False)
@@ -60,6 +52,10 @@
     vcvars = None
     try:
         toolsdir = os.environ['VS%sCOMNTOOLS' % vsver]
+        if x64flag:
+            vcvars = os.path.join(toolsdir, "vcvarsamd64.bat")
+        else:
+            vcvars = os.path.join(toolsdir, 'vsvars32.bat')
     except KeyError:
         # try to import from the registry, as done in setuptools
         # XXX works for 90 but is it generalizable?


More information about the pypy-commit mailing list