8000 Adds linker options needed for compilation on recent OSX system (issu… · PaulEcoffet/python_example@7b86945 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b86945

Browse files
fakufakuwjakob
authored andcommitted
Adds linker options needed for compilation on recent OSX system (issue pybind#22). (pybind#42)
1 parent 2ed5a68 commit 7b86945

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,20 @@ class BuildExt(build_ext):
7171
'msvc': ['/EHsc'],
7272
'unix': [],
7373
}
74+
l_opts = {
75+
'msvc': [],
76+
'unix': [],
77+
}
7478

7579
if sys.platform == 'darwin':
76-
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
80+
darwin_opts = ['-stdlib=libc++', '-mmacosx-version-min=10.7']
81+
c_opts['unix'] += darwin_opts
82+
l_opts['unix'] += darwin_opts
7783

7884
def build_extensions(self):
7985
ct = self.compiler.compiler_type
8086
opts = self.c_opts.get(ct, [])
87+
link_opts = self.l_opts.get(ct, [])
8188
if ct == 'unix':
8289
opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version())
8390
opts.append(cpp_flag(self.compiler))
@@ -87,6 +94,7 @@ def build_extensions(self):
8794
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
8895
for ext in self.extensions:
8996
ext.extra_compile_args = opts
97+
ext.extra_link_args = link_opts
9098
build_ext.build_extensions(self)
9199

92100
setup(

0 commit comments

Comments
 (0)
0