PythonExtensionsOnWindows: msvccompiler.py.patch

File msvccompiler.py.patch, 2.6 KB (added by patrickkidd, 5 years ago)
  • .py

    old new  
    126126        self.set_macro("FrameworkDir", net, "installroot") 
    127127        try: 
    128128            if version > 7.0: 
    129                 self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") 
     129                # pks 
     130                                try: 
     131                                        self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") 
     132                                except KeyError: 
     133                                        self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv2.0") 
    130134            else: 
    131135                self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") 
    132136        except KeyError, exc: # 
     
    288292 
    289293        self.preprocess_options = None 
    290294        if self.__arch == "Intel": 
    291             self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GX' , 
    292                                      '/DNDEBUG'] 
    293             self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GX', 
    294                                           '/Z7', '/D_DEBUG'] 
     295            if get_build_version() > 7: 
     296                self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/EHsc' , 
     297                                         '/DNDEBUG'] 
     298                self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/EHsc', 
     299                                              '/Z7', '/D_DEBUG'] 
     300            else: 
     301                self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GX' , 
     302                                         '/DNDEBUG'] 
     303                self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GX', 
     304                                              '/Z7', '/D_DEBUG'] 
     305             
    295306        else: 
    296307            # Win64 
    297308            self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GS-' , 
     
    609620 
    610621        if not _can_read_reg: 
    611622            return [] 
     623             
     624                #pks 
     625        if self.__version >= 8: 
     626                         
     627                        # With .NET 8.0, the environment variables are not stored in the  
     628                        # registry anymore.  They are stored in a platform specific file 
     629                        # under C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages\ 
     630                        # Instead of parsing these files (which I don't know how to do), 
     631                        # we simply rely on the fact that the python script is being  
     632                        # called from a "Visual Studio 2005 Command Prompt".  In these 
     633                        # consoles, the environment variables are properly defined. 
     634                         
     635                        real_path = path 
     636                        if path == "library": 
     637                                real_path = "lib"; 
     638                        return string.split(os.environ[real_path], ";")             
    612639 
    613640        path = path + " dirs" 
    614641        if self.__version >= 7: