@@ -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+
5461if 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
6971else :
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
185180sass_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