public
Description: wxWidgets Python bindings
Homepage: http://code.google.com/p/wxpy
Clone URL: git://github.com/kevinwatters/wxpy.git
distutils MSVC hack should only apply on Windows
kevinw (author)
Fri May 16 14:13:07 -0700 2008
commit  9b1dfa39d2ba9e54af86ddc0e19e358c75f1a6d2
tree    a135134a5767592f48a78229c9403287d53b3069
parent  6c93427a63845cee2ad2b22dbc57c7072d6b92fd
...
7
8
9
 
10
11
12
...
117
118
119
120
121
122
123
124
125
126
127
128
129
 
 
 
 
 
 
 
 
 
 
 
130
131
...
7
8
9
10
11
12
13
...
118
119
120
 
 
 
 
 
 
 
 
 
 
121
122
123
124
125
126
127
128
129
130
131
132
133
0
@@ -7,6 +7,7 @@ utils for building wxpy or wxpy extensions
0
 from __future__ import with_statement
0
 
0
 import itertools
0
+import os
0
 import shutil
0
 import sipconfig
0
 import sipdistutils
0
@@ -117,15 +118,16 @@ def make_sip_ext(name, iface_files, include = None, libs = []):
0
     ext = Extension(name, iface_files, extra_compile_args = cargs, extra_link_args = largs)
0
     ext.extra_sip_includes = includes
0
 
0
- # HACK! disutils wants to include /DNDEBUG but we
0
- # are using __WXDEBUG__, which needs it
0
- from distutils.msvc9compiler import MSVCCompiler
0
- old_initialize = MSVCCompiler.initialize
0
- def new_initialize(self, plat_name=None):
0
- res = old_initialize(self, plat_name)
0
- if '/DNDEBUG' in self.compile_options:
0
- self.compile_options.remove('/DNDEBUG')
0
- return res
0
- MSVCCompiler.initialize = new_initialize
0
+ if os.name == 'nt':
0
+ # HACK! disutils wants to include /DNDEBUG but we
0
+ # are using __WXDEBUG__, which needs it
0
+ from distutils.msvc9compiler import MSVCCompiler
0
+ old_initialize = MSVCCompiler.initialize
0
+ def new_initialize(self, plat_name=None):
0
+ res = old_initialize(self, plat_name)
0
+ if '/DNDEBUG' in self.compile_options:
0
+ self.compile_options.remove('/DNDEBUG')
0
+ return res
0
+ MSVCCompiler.initialize = new_initialize
0
 
0
     return ext

Comments

    No one has commented yet.