Skip to content

Commit b5313cc

Browse files
authored
Merge pull request #271 from asottile/lcpp_macos
Use -lc++ on macos too
2 parents 92fd89d + ca6f2b0 commit b5313cc

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

setup.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,23 @@ def _maybe_macos(flags):
5151
)
5252

5353

54+
if sys.platform == 'win32':
55+
extra_link_args = []
56+
elif platform.system() in {'Darwin', 'FreeBSD'}:
57+
extra_link_args = ['-fPIC', '-lc++']
58+
else:
59+
extra_link_args = ['-fPIC', '-lstdc++']
60+
5461
if system_sass:
5562
flags = [
5663
'-fPIC', '-std=gnu++0x', '-Wall', '-Wno-parentheses', '-Werror=switch',
5764
]
5865
_maybe_clang(flags)
5966
_maybe_macos(flags)
6067

61-
if platform.system() == 'FreeBSD':
62-
link_flags = ['-fPIC', '-lc++']
63-
else:
64-
link_flags = ['-fPIC', '-lstdc++']
6568
libraries = ['sass']
6669
include_dirs = []
6770
extra_compile_args = flags
68-
extra_link_args = link_flags
6971
else:
7072
LIBSASS_SOURCE_DIR = os.path.join('libsass', 'src')
7173

@@ -136,7 +138,6 @@ def _maybe_macos(flags):
136138
msvc9compiler.get_build_version = lambda: 14.0
137139
msvc9compiler.VERSION = 14.0
138140
flags = ['/Od', '/EHsc', '/MT']
139-
link_flags = []
140141
else:
141142
flags = [
142143
'-fPIC', '-std=gnu++0x', '-Wall',
@@ -172,23 +173,17 @@ def restore_cencode():
172173
with open(cencode_path, 'w') as f:
173174
f.write(cencode_body)
174175

175-
if platform.system() == 'FreeBSD':
176-
link_flags = ['-fPIC', '-lc++']
177-
else:
178-
link_flags = ['-fPIC', '-lstdc++']
179-
180176
libraries = []
181177
include_dirs = [os.path.join('.', 'libsass', 'include')]
182178
extra_compile_args = flags + [version_define]
183-
extra_link_args = link_flags
184179

185180
sass_extension = Extension(
186181
'_sass',
187182
sorted(sources),
188183
include_dirs=include_dirs,
189184
depends=headers,
190185
extra_compile_args=extra_compile_args,
191-
extra_link_args=link_flags,
186+
extra_link_args=extra_link_args,
192187
libraries=libraries,
193188
)
194189

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy