fix setup.py

This commit is contained in:
Wolf Vollprecht 2019-03-22 14:32:53 +01:00
parent 091e270782
commit 84cb113ce4
1 changed files with 8 additions and 6 deletions

View File

@ -63,14 +63,15 @@ class BuildExt(build_ext):
'unix': ['-std=c++17', '-march=core-avx2', '-O3'],
}
if sys.platform == 'darwin':
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
if not has_flag(self.compiler, '-std=c++17'):
c_opts.remove('-std=c++17')
c_opts.append('-std=c++1z')
def build_extensions(self):
ct = self.compiler.compiler_type
if sys.platform == 'darwin':
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
if not has_flag(self.compiler, '-std=c++17'):
c_opts.remove('-std=c++17')
c_opts.append('-std=c++1z')
opts = self.c_opts.get(ct, [])
if ct == 'unix':
opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version())
@ -78,6 +79,7 @@ class BuildExt(build_ext):
opts.append('-fvisibility=hidden')
elif ct == 'msvc':
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
for ext in self.extensions:
ext.extra_compile_args = opts
build_ext.build_extensions(self)