mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Move setting the environment variables into getMSVCInfo
This commit is contained in:
7
build.py
7
build.py
@@ -792,12 +792,7 @@ def checkCompiler(quiet=False):
|
|||||||
# about time to do away with this...)
|
# about time to do away with this...)
|
||||||
|
|
||||||
arch = 'x64' if PYTHON_ARCH == '64bit' else 'x86'
|
arch = 'x64' if PYTHON_ARCH == '64bit' else 'x86'
|
||||||
info = getMSVCInfo(PYTHON, arch)
|
info = getMSVCInfo(PYTHON, arch, set_env=True)
|
||||||
|
|
||||||
os.environ['PATH'] = info.path
|
|
||||||
os.environ['INCLUDE'] = info.include
|
|
||||||
os.environ['LIB'] = info.lib
|
|
||||||
os.environ['LIBPATH'] = info.libpath
|
|
||||||
|
|
||||||
# Make sure there is now a cl.exe on the PATH
|
# Make sure there is now a cl.exe on the PATH
|
||||||
CL = 'NOT FOUND'
|
CL = 'NOT FOUND'
|
||||||
|
|||||||
@@ -981,7 +981,7 @@ def getExpectedVisCVersion():
|
|||||||
|
|
||||||
|
|
||||||
MSVCinfo = None
|
MSVCinfo = None
|
||||||
def getMSVCInfo(PYTHON, arch):
|
def getMSVCInfo(PYTHON, arch, set_env=False):
|
||||||
"""
|
"""
|
||||||
Fetch info from the system about MSVC, such as versions, paths, etc.
|
Fetch info from the system about MSVC, such as versions, paths, etc.
|
||||||
"""
|
"""
|
||||||
@@ -1005,6 +1005,12 @@ def getMSVCInfo(PYTHON, arch):
|
|||||||
env = eval(runcmd('"%s" -c "%s"' % (PYTHON, cmd), getOutput=True, echoCmd=False))
|
env = eval(runcmd('"%s" -c "%s"' % (PYTHON, cmd), getOutput=True, echoCmd=False))
|
||||||
info = AttrDict(env)
|
info = AttrDict(env)
|
||||||
|
|
||||||
|
if set_env:
|
||||||
|
os.environ['PATH'] = info.path
|
||||||
|
os.environ['INCLUDE'] = info.include
|
||||||
|
os.environ['LIB'] = info.lib
|
||||||
|
os.environ['LIBPATH'] = info.libpath
|
||||||
|
|
||||||
MSVCinfo = info
|
MSVCinfo = info
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user