diff --git a/build.py b/build.py index 6a6f6225..e2d17448 100755 --- a/build.py +++ b/build.py @@ -29,7 +29,8 @@ from distutils.dep_util import newer, newer_group from buildtools.config import Config, msg, opj, posixjoin, loadETG, etg2sip, findCmd, \ phoenixDir, wxDir, copyIfNewer, copyFile, \ macFixDependencyInstallName, macSetLoaderNames, \ - getSvnRev, runcmd, textfile_open, getSipFiles + getSvnRev, runcmd, textfile_open, getSipFiles, \ + getVisCVersion import buildtools.version as version @@ -267,9 +268,9 @@ def getMSWSettings(options): msw = MSWsettings() msw.CPU = os.environ.get('CPU') if msw.CPU == 'AMD64': - msw.dllDir = posixjoin(wxDir(), "lib", "vc_amd64_dll") + msw.dllDir = posixjoin(wxDir(), "lib", "vc%s_amd64_dll" % getVisCVersion()) else: - msw.dllDir = posixjoin(wxDir(), "lib", "vc_dll") + msw.dllDir = posixjoin(wxDir(), "lib", "vc%s_dll" % getVisCVersion()) msw.buildDir = posixjoin(wxDir(), "build", "msw") msw.dll_type = "u" @@ -1098,7 +1099,7 @@ def clean_wx(options, args): deleteIfExists(opj(msw.dllDir, 'msw'+msw.dll_type)) delFiles(glob.glob(opj(msw.dllDir, 'wx*%s%s*' % (version2_nodot, msw.dll_type)))) delFiles(glob.glob(opj(msw.dllDir, 'wx*%s%s*' % (version3_nodot, msw.dll_type)))) - deleteIfExists(opj(msw.buildDir, 'vc_msw'+msw.dll_type+'dll')) + deleteIfExists(opj(msw.buildDir, 'vc%s_msw%sdll' % (getVisCVersion(), +msw.dll_type))) if options.both: options.debug = False @@ -1221,9 +1222,7 @@ def bdist(options, args): readme = "packaging/README.txt" wxlibdir = os.path.join(getBuildDir(options), "lib") if sys.platform.startswith('win'): - #dllext = ".dll" - #wxlibdir = os.path.join(wxDir(), "lib", "vc_dll") - environ_script = None #"packaging/phoenix_environ.bat" + environ_script = None elif sys.platform.startswith('darwin'): dllext = ".dylib" diff --git a/buildtools/config.py b/buildtools/config.py index c83059d9..4c4ad350 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -155,9 +155,9 @@ class Configuration(object): self.WXPLAT = '__WXMSW__' if os.environ.get('CPU', None) == 'AMD64': - self.VCDLL = 'vc_amd64_dll' + self.VCDLL = 'vc%s_amd64_dll' % getVisCVersion() else: - self.VCDLL = 'vc_dll' + self.VCDLL = 'vc%s_dll' % getVisCVersion() self.includes += ['include', opj(self.WXDIR, 'lib', self.VCDLL, 'msw' + self.libFlag()), @@ -829,3 +829,11 @@ def getSipFiles(names): +def getVisCVersion(): + text = runcmd("cl.exe", getOutput=True) + if 'Version 15' in text: + return '90' + # TODO: Add more tests to get the other versions... + else: + return 'FIXME' +