Commit 74d747a9 authored by Matt Harbison's avatar Matt Harbison
Browse files

run the equivalent of vcvarsall.bat when using 'Visual C++ for Python 2.7'

This means that any command prompt will properly build everything, whereas
before the 'Visual C++ 2008 64-bit Cross Tools Command Prompt' was required.
The goal is to remove a point of failure (the plain 64-bit prompt fails), and to
move towards automated builds like core Mercurial.  I've only got the Express
edition at home (which fails to build this), so I'm not doing the same for
Visual Studio 2008.
parent 17b24295a60e
......@@ -237,6 +237,36 @@ def get_sdkenv(arch):
if k.lower() in sdkenv_vars:
newenv[k.upper()] = v
env = installenv.copy()
# As a convenience, activate the proper environment if the standalone python
# compiler is being used. Core Mercurial packaging does this in Powershell.
if 'Visual C++ for Python' in win7sdk:
vars = {
'root': (r'%s\Programs\Common\Microsoft\Visual C++ for Python\9.0'
% env['LOCALAPPDATA']),
'path': env['PATH'],
'lib': env.get('LIB', ''),
'libpath': env.get('LIBPATH', ''),
}
newenv['VCINSTALLDIR'] = r"%(root)s\VC\\" % vars
newenv['WindowsSdkDir'] = r'%(root)s\WinSDK\\' % vars
newenv['INCLUDE'] = (r'%(root)s\VC\Include;%(root)s\WinSDK\Include;%(path)s'
% vars)
if arch == 'x86':
newenv['PATH'] = r"%(root)s\VC\Bin;%(root)s\WinSDK\Bin;%(path)s" % vars
newenv['LIB'] = r"%(root)s\VC\Lib;%(root)s\WinSDK\Lib;%(lib)s" % vars
newenv['LIBPATH'] = (r"%(root)s\VC\lib;%(root)s\WinSDK\Lib;%(libpath)s"
% vars)
else:
newenv['PATH'] = (r"%(root)s\VC\Bin\amd64;%(root)s\WinSDK\Bin\x64;%(root)s\WinSDK\Bin;%(path)s"
% vars)
newenv['LIB'] = (r"%(root)s\VC\Lib\amd64;%(root)s\WinSDK\Lib\x64;%(lib)s"
% vars)
newenv['LIBPATH'] = (r"%(root)s\VC\Lib\amd64;%(root)s\WinSDK\Lib\x64;%(libpath)s"
% vars)
env.update(newenv)
sdkenvs[arch] = env
return env
......
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