File tree Expand file tree Collapse file tree 4 files changed +19
-15
lines changed Expand file tree Collapse file tree 4 files changed +19
-15
lines changed Original file line number Diff line number Diff line change 33from setuptools import setup , Extension
44
55import glob
6+ import os
67import re
78import sys
89
910
1011if hasattr (sys , 'pypy_version_info' ):
1112 ext_modules = []
1213else :
13- if sys .platform == 'win32' and '32 bit' in sys .version :
14- extra_objects = ['src/switch_x86_msvc.obj' ]
15- elif sys .platform == 'win32' and '64 bit' in sys .version :
16- extra_objects = ['src/switch_x64_msvc.obj' ]
17- else :
18- extra_objects = []
14+ extra_objects = []
15+ if sys .platform == 'win32' :
16+ # This is a hack because msvc9compiler doesn't support asm files
17+ # http://bugs.python.org/issue7546
18+
19+ # Initialize compiler
20+ from distutils .msvc9compiler import MSVCCompiler
21+ cc = MSVCCompiler ()
22+ cc .initialize ()
23+ del cc
24+
25+ if '32 bit' in sys .version :
26+ extra_objects = ['src/switch_x86_msvc.obj' ]
27+ os .system ('ml /nologo /c /Fo src\switch_x86_msvc.obj src\switch_x86_msvc.asm' )
28+ else :
29+ extra_objects = ['src/switch_x64_msvc.obj' ]
30+ os .system ('ml64 /nologo /c /Fo src\switch_x64_msvc.obj src\switch_x64_msvc.asm' )
31+
1932 ext_modules = [Extension ('fibers._cfibers' ,
2033 sources = glob .glob ('src/*.c' ),
2134 extra_objects = extra_objects ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments