Skip to content
Prev Previous commit
Next Next commit
Move to appropriate context
  • Loading branch information
vmuriart committed Jan 30, 2017
commit 0078d7600e0337d2cec77773f7c2aa58f81b90c8
28 changes: 13 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,6 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
raise RuntimeError("%s could not be found" % tool)


if DEVTOOLS == "MsDev":
_xbuild = "\"%s\"" % _find_msbuild_tool("msbuild.exe")
_defines_sep = ";"
_config = "%sWin" % CONFIG

elif DEVTOOLS == "Mono":
_xbuild = "xbuild"
_defines_sep = ","
_config = "%sMono" % CONFIG

else:
raise NotImplementedError(
"DevTools %s not supported (use MsDev or Mono)" % DEVTOOLS)


class BuildExtPythonnet(build_ext.build_ext):
def build_extension(self, ext):
"""Builds the .pyd file using msbuild or xbuild"""
Expand Down Expand Up @@ -180,6 +165,19 @@ def build_extension(self, ext):
geninterop = os.path.join("tools", "geninterop", "geninterop.py")
subprocess.check_call([sys.executable, geninterop, interop_file])

if DEVTOOLS == "MsDev":
_xbuild = '"{0}"'.format(_find_msbuild_tool("msbuild.exe"))
_defines_sep = ";"
_config = "{0}Win".format(CONFIG)

elif DEVTOOLS == "Mono":
_xbuild = "xbuild"
_defines_sep = ","
_config = "{0}Mono".format(CONFIG)
else:
raise NotImplementedError(
"DevTool {0} not supported (use MsDev/Mono)".format(DEVTOOLS))

cmd = [
_xbuild,
"pythonnet.sln",
Expand Down