Browse Source

Adds linker options needed for compilation on recent OSX system (issue #22). (#42)

master
Robin Scheibler 6 years ago committed by Wenzel Jakob
parent
commit
7b869458f5
  1. 10
      setup.py

10
setup.py

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

Loading…
Cancel
Save