@@ -62,17 +62,28 @@ def _check_compiler (self):
62
62
e = get_exception ()
63
63
msg = """\
64
64
Could not initialize compiler instance: do you have Visual Studio
65
- installed ? If you are trying to build with mingw, please use python setup.py
66
- build -c mingw32 instead ). If you have Visual Studio installed, check it is
67
- correctly installed, and the right version (VS 2008 for python 2.6, VS 2003 for
68
- 2.5, etc...). Original exception was: %s, and the Compiler
69
- class was %s
65
+ installed? If you are trying to build with MinGW, please use "python setup.py
66
+ build -c mingw32" instead. If you have Visual Studio installed, check it is
67
+ correctly installed, and the right version (VS 2008 for python 2.6, 2.7 and 3.2,
68
+ VS 2010 for >= 3.3).
69
+
70
+ Original exception was: %s, and the Compiler class was %s
70
71
============================================================================""" \
71
72
% (e , self .compiler .__class__ .__name__ )
72
73
print ("""\
73
74
============================================================================""" )
74
75
raise distutils .errors .DistutilsPlatformError (msg )
75
76
77
+ # After MSVC is initialized, add an explicit /MANIFEST to linker
78
+ # flags. See issues gh-4245 and gh-4101 for details. Also
79
+ # relevant are issues 4431 and 16296 on the Python bug tracker.
80
+ from distutils import msvc9compiler
81
+ if msvc9compiler .get_build_version () >= 10 :
82
+ for ldflags in [self .compiler .ldflags_shared ,
83
+ self .compiler .ldflags_shared_debug ]:
84
+ if '/MANIFEST' not in ldflags :
85
+ ldflags .append ('/MANIFEST' )
86
+
76
87
if not isinstance (self .fcompiler , FCompiler ):
77
88
self .fcompiler = new_fcompiler (compiler = self .fcompiler ,
78
89
dry_run = self .dry_run , force = 1 ,
0 commit comments