Skip to content

Commit 0078d76

Browse files
committed
Move to appropriate context
1 parent 5359098 commit 0078d76

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

setup.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,6 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
103103
raise RuntimeError("%s could not be found" % tool)
104104

105105

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-
121106
class BuildExtPythonnet(build_ext.build_ext):
122107
def build_extension(self, ext):
123108
"""Builds the .pyd file using msbuild or xbuild"""
@@ -180,6 +165,19 @@ def build_extension(self, ext):
180165
geninterop = os.path.join("tools", "geninterop", "geninterop.py")
181166
subprocess.check_call([sys.executable, geninterop, interop_file])
182167

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+
183181
cmd = [
184182
_xbuild,
185183
"pythonnet.sln",

0 commit comments

Comments
 (0)