@@ -103,21 +103,6 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
103
103
raise RuntimeError ("%s could not be found" % tool )
104
104
105
105
106
- if DEVTOOLS == "MsDev" :
107
- _xbuild = "\" %s\" " % _find_msbuild_tool ("msbuild.exe" )
108
- _defines_sep = ";"
109
- _config = "%sWin" % CONFIG
110
-
111
- elif DEVTOOLS == "Mono" :
112
- _xbuild = "xbuild"
113
- _defines_sep = ","
114
- _config = "%sMono" % CONFIG
115
-
116
- else :
117
- raise NotImplementedError (
118
- "DevTools %s not supported (use MsDev or Mono)" % DEVTOOLS )
119
-
120
-
121
106
class BuildExtPythonnet (build_ext .build_ext ):
122
107
def build_extension (self , ext ):
123
108
"""Builds the .pyd file using msbuild or xbuild"""
@@ -180,6 +165,19 @@ def build_extension(self, ext):
180
165
geninterop = os .path .join ("tools" , "geninterop" , "geninterop.py" )
181
166
subprocess .check_call ([sys .executable , geninterop , interop_file ])
182
167
168
+ if DEVTOOLS == "MsDev" :
169
+ _xbuild = '"{0}"' .format (_find_msbuild_tool ("msbuild.exe" ))
170
+ _defines_sep = ";"
171
+ _config = "{0}Win" .format (CONFIG )
172
+
173
+ elif DEVTOOLS == "Mono" :
174
+ _xbuild = "xbuild"
175
+ _defines_sep = ","
176
+ _config = "{0}Mono" .format (CONFIG )
177
+ else :
178
+ raise NotImplementedError (
179
+ "DevTool {0} not supported (use MsDev/Mono)" .format (DEVTOOLS ))
180
+
183
181
cmd = [
184
182
_xbuild ,
185
183
"pythonnet.sln" ,
0 commit comments