Commit 07d2ef75 authored by Martin v. Löwis's avatar Martin v. Löwis

Let the SDK setup override distutils logic.

parent dc8d4ae1
...@@ -214,21 +214,31 @@ class MSVCCompiler (CCompiler) : ...@@ -214,21 +214,31 @@ class MSVCCompiler (CCompiler) :
self.initialized = False self.initialized = False
def initialize(self): def initialize(self):
self.__paths = self.get_msvc_paths("path") self.__paths = []
if os.environ.has_key("MSSdk") and self.find_exe("cl.exe"):
if len (self.__paths) == 0: # Assume that the SDK set up everything alright; don't try to be
raise DistutilsPlatformError, \ # smarter
("Python was built with version %s of Visual Studio, " self.cc = "cl.exe"
"and extensions need to be built with the same " self.linker = "link.exe"
"version of the compiler, but it isn't installed." % self.__version) self.lib = "lib.exe"
self.rc = "rc.exe"
self.cc = self.find_exe("cl.exe") self.mc = "mc.exe"
self.linker = self.find_exe("link.exe") else:
self.lib = self.find_exe("lib.exe") self.__paths = self.get_msvc_paths("path")
self.rc = self.find_exe("rc.exe") # resource compiler
self.mc = self.find_exe("mc.exe") # message compiler if len (self.__paths) == 0:
self.set_path_env_var('lib') raise DistutilsPlatformError, \
self.set_path_env_var('include') ("Python was built with version %s of Visual Studio, "
"and extensions need to be built with the same "
"version of the compiler, but it isn't installed." % self.__version)
self.cc = self.find_exe("cl.exe")
self.linker = self.find_exe("link.exe")
self.lib = self.find_exe("lib.exe")
self.rc = self.find_exe("rc.exe") # resource compiler
self.mc = self.find_exe("mc.exe") # message compiler
self.set_path_env_var('lib')
self.set_path_env_var('include')
# extend the MSVC path with the current path # extend the MSVC path with the current path
try: try:
......
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