* Try to fix win32 compilation

This commit is contained in:
Matthew Honnibal 2016-02-05 14:43:52 +01:00
parent 1ef84a0557
commit 8bd16ce8f7
1 changed files with 16 additions and 10 deletions

View File

@ -68,18 +68,24 @@ if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[0:2] < (3, 4):
raise RuntimeError('Python version 2.7 or >= 3.4 required.') raise RuntimeError('Python version 2.7 or >= 3.4 required.')
# By subclassing build_extensions we have the actual compiler that will be used which is really known only after finalize_options # By subclassing build_extensions we have the actual compiler that will be used
# which is really known only after finalize_options
# http://stackoverflow.com/questions/724664/python-distutils-how-to-get-a-compiler-that-is-going-to-be-used # http://stackoverflow.com/questions/724664/python-distutils-how-to-get-a-compiler-that-is-going-to-be-used
compile_options = {'msvc' : ['/Ox', '/EHsc'], compile_options = {
'other' : ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function']} 'msvc': ['/Ox', '/EHsc'],
link_options = {'msvc' : [], 'mingw32' : ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function'],
'other' : []} 'other' : ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function']
}
if sys.platform.startswith('darwin'):
compile_options['other'].append('-mmacosx-version-min=10.8') link_options = {
compile_options['other'].append('-stdlib=libc++') 'msvc' : [],
link_options['other'].append('-lc++') 'mingw32': [],
else: 'other' : []
}
if not sys.platform.startswith('darwin'):
compile_options['other'].append('-fopenmp') compile_options['other'].append('-fopenmp')
link_options['other'].append('-fopenmp') link_options['other'].append('-fopenmp')