2
2
Setup script for building clr.pyd and dependencies using mono and into
3
3
an egg or wheel.
4
4
"""
5
+
5
6
from setuptools import setup , Extension
6
7
from distutils .command .build_ext import build_ext
7
8
from distutils .command .install_lib import install_lib
@@ -28,6 +29,18 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
28
29
import winreg as _winreg
29
30
30
31
if use_windows_sdk :
32
+ if sys .version_info [:2 ] == (2 ,7 ):
33
+ locappdir = os .environ ["LOCALAPPDATA" ]
34
+ vcpy27 = (r"Programs\Common\Microsoft"
35
+ r"\Visual C++ for Python\9.0\WinSDK\Bin" )
36
+ if PLATFORM == "x86" :
37
+ mtpath = os .path .join (
38
+ locappdir , vcpy27 , r"mt.exe" )
39
+ elif PLATFORM == "x64" :
40
+ mtpath = os .path .join (
41
+ locappdir , vcpy27 , r"x64\mt.exe" )
42
+ if os .path .exists (mtpath ):
43
+ return mtpath
31
44
value_name = "InstallationFolder"
32
45
sdk_name = "Windows SDK"
33
46
keys_to_check = [
@@ -41,6 +54,7 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False):
41
54
value_name = "MSBuildToolsPath"
42
55
sdk_name = "MSBuild"
43
56
keys_to_check = [
57
+ r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" ,
44
58
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0" ,
45
59
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" ,
46
60
r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5" ,
@@ -148,7 +162,7 @@ def build_extension(self, ext):
148
162
"/p:Configuration=%s" % _config ,
149
163
"/p:Platform=%s" % PLATFORM ,
150
164
"/p:DefineConstants=\" %s\" " % _defines_sep .join (defines ),
151
- "/p:PythonBuildDir=%s " % os .path .abspath (dest_dir ),
165
+ "/p:PythonBuildDir=\" %s \" " % os .path .abspath (dest_dir ),
152
166
"/verbosity:%s" % VERBOSITY ,
153
167
]
154
168
@@ -314,4 +328,3 @@ def _check_output(*popenargs, **kwargs):
314
328
"install_data" : PythonNET_InstallData ,
315
329
}
316
330
)
317
-
0 commit comments