|
|
|
@ -71,13 +71,20 @@ class BuildExt(build_ext):
@@ -71,13 +71,20 @@ class BuildExt(build_ext):
|
|
|
|
|
'msvc': ['/EHsc'], |
|
|
|
|
'unix': [], |
|
|
|
|
} |
|
|
|
|
l_opts = { |
|
|
|
|
'msvc': [], |
|
|
|
|
'unix': [], |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if sys.platform == 'darwin': |
|
|
|
|
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7'] |
|
|
|
|
darwin_opts = ['-stdlib=libc++', '-mmacosx-version-min=10.7'] |
|
|
|
|
c_opts['unix'] += darwin_opts |
|
|
|
|
l_opts['unix'] += darwin_opts |
|
|
|
|
|
|
|
|
|
def build_extensions(self): |
|
|
|
|
ct = self.compiler.compiler_type |
|
|
|
|
opts = self.c_opts.get(ct, []) |
|
|
|
|
link_opts = self.l_opts.get(ct, []) |
|
|
|
|
if ct == 'unix': |
|
|
|
|
opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version()) |
|
|
|
|
opts.append(cpp_flag(self.compiler)) |
|
|
|
@ -87,6 +94,7 @@ class BuildExt(build_ext):
@@ -87,6 +94,7 @@ class BuildExt(build_ext):
|
|
|
|
|
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version()) |
|
|
|
|
for ext in self.extensions: |
|
|
|
|
ext.extra_compile_args = opts |
|
|
|
|
ext.extra_link_args = link_opts |
|
|
|
|
build_ext.build_extensions(self) |
|
|
|
|
|
|
|
|
|
setup( |
|
|
|
|