2
2
Setup script for building clr.pyd and dependencies using mono and into
3
3
an egg or wheel.
4
4
"""
5
+ #import ptvsd
6
+ #ptvsd.enable_attach('pythonnet')
7
+ #while not ptvsd.is_attached():
8
+ # from time import sleep
9
+ # sleep(1)
10
+
5
11
from setuptools import setup , Extension
6
12
from distutils .command .build_ext import build_ext
7
13
from distutils .command .install_lib import install_lib
@@ -28,6 +34,18 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
28
34
import winreg as _winreg
29
35
30
36
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
31
49
value_name = "InstallationFolder"
32
50
sdk_name = "Windows SDK"
33
51
keys_to_check = [
@@ -41,6 +59,7 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
41
59
value_name = "MSBuildToolsPath"
42
60
sdk_name = "MSBuild"
43
61
keys_to_check = [
62
+ r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" ,
44
63
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0" ,
45
64
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" ,
46
65
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5" ,
@@ -148,7 +167,7 @@ def build_extension(self, ext):
148
167
"/p:Configuration=%s" % _config ,
149
168
"/p:Platform=%s" % PLATFORM ,
150
169
"/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 ),
152
171
"/verbosity:%s" % VERBOSITY ,
153
172
]
154
173
@@ -314,4 +333,3 @@ def _check_output(*popenargs, **kwargs):
314
333
"install_data" : PythonNET_InstallData ,
315
334
}
316
335
)
317
-
0 commit comments