Skip to content

Commit bd5ee3c

Browse files
author
denfromufa
committed
Update setup.py
1 parent 20e1d37 commit bd5ee3c

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

setup.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Setup script for building clr.pyd and dependencies using mono and into
33
an egg or wheel.
44
"""
5+
#import ptvsd
6+
#ptvsd.enable_attach('pythonnet')
7+
#while not ptvsd.is_attached():
8+
# from time import sleep
9+
# sleep(1)
10+
511
from setuptools import setup, Extension
612
from distutils.command.build_ext import build_ext
713
from distutils.command.install_lib import install_lib
@@ -28,6 +34,18 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
2834
import winreg as _winreg
2935

3036
if use_windows_sdk:
37+
if sys.version_info[:2] == (2,7):
38+
locappdir = os.environ["LOCALAPPDATA"]
39+
vcpy27 = (r"Programs\Common\Microsoft"
40+
r"\Visual C++ for Python\9.0\WinSDK\Bin")
41+
if PLATFORM == "x86":
42+
mtpath = os.path.join(
43+
locappdir, vcpy27, r"mt.exe")
44+
elif PLATFORM == "x64":
45+
mtpath = os.path.join(
46+
locappdir, vcpy27, r"x64\mt.exe")
47+
if os.path.exists(mtpath):
48+
return mtpath
3149
value_name = "InstallationFolder"
3250
sdk_name = "Windows SDK"
3351
keys_to_check = [
@@ -41,6 +59,7 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
4159
value_name = "MSBuildToolsPath"
4260
sdk_name = "MSBuild"
4361
keys_to_check = [
62+
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0",
4463
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0",
4564
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0",
4665
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5",
@@ -148,7 +167,7 @@ def build_extension(self, ext):
148167
"/p:Configuration=%s" % _config,
149168
"/p:Platform=%s" % PLATFORM,
150169
"/p:DefineConstants=\"%s\"" % _defines_sep.join(defines),
151-
"/p:PythonBuildDir=%s" % os.path.abspath(dest_dir),
170+
"/p:PythonBuildDir=\"%s\"" % os.path.abspath(dest_dir),
152171
"/verbosity:%s" % VERBOSITY,
153172
]
154173

@@ -314,4 +333,3 @@ def _check_output(*popenargs, **kwargs):
314333
"install_data": PythonNET_InstallData,
315334
}
316335
)
317-

0 commit comments

Comments
 (0)