mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Adding support for Microsoft Visual C++ Compiler for Python 2.7
This commit is contained in:
4
build.py
4
build.py
@@ -723,7 +723,9 @@ def checkCompiler(quiet=False):
|
||||
# Make sure that the compiler that Python wants to use can be found.
|
||||
# It will terminate if the compiler is not found or other exceptions
|
||||
# are raised.
|
||||
# setuptools is imported to address https://bugs.python.org/issue23246
|
||||
cmd = "import distutils.msvc9compiler as msvc; " \
|
||||
"import setuptools; " \
|
||||
"mc = msvc.MSVCCompiler(); " \
|
||||
"mc.initialize(); " \
|
||||
"print(mc.cc)"
|
||||
@@ -734,7 +736,9 @@ def checkCompiler(quiet=False):
|
||||
# Now get the environment variables which that compiler needs from
|
||||
# its vcvarsall.bat command and load them into this process's
|
||||
# environment.
|
||||
# setuptools is imported to address https://bugs.python.org/issue23246
|
||||
cmd = "import distutils.msvc9compiler as msvc; " \
|
||||
"import setuptools; " \
|
||||
"arch = msvc.PLAT_TO_VCVARS[msvc.get_platform()]; " \
|
||||
"env = msvc.query_vcvarsall(msvc.VERSION, arch); " \
|
||||
"print(env)"
|
||||
|
||||
3
wscript
3
wscript
@@ -74,6 +74,7 @@ def configure(conf):
|
||||
msvc_version = str( distutils.msvc9compiler.get_build_version() )
|
||||
conf.env['MSVC_VERSIONS'] = ['msvc ' + msvc_version]
|
||||
conf.env['MSVC_TARGETS'] = [conf.options.msvc_arch]
|
||||
conf.env['NO_MSVC_DETECT'] = 1
|
||||
conf.load('msvc')
|
||||
else:
|
||||
conf.load('compiler_cc compiler_cxx')
|
||||
@@ -415,6 +416,8 @@ def my_check_python_headers(conf):
|
||||
|
||||
if env.CC_NAME == "msvc":
|
||||
from distutils.msvccompiler import MSVCCompiler
|
||||
# setuptools is imported to address https://bugs.python.org/issue23246
|
||||
import setuptools
|
||||
dist_compiler = MSVCCompiler()
|
||||
dist_compiler.initialize()
|
||||
env.append_value('CFLAGS_PYEXT', dist_compiler.compile_options)
|
||||
|
||||
Reference in New Issue
Block a user