Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,23 @@ def _maybe_macos(flags):
)


if sys.platform == 'win32':
extra_link_args = []
elif platform.system() in {'Darwin', 'FreeBSD'}:
extra_link_args = ['-fPIC', '-lc++']
else:
extra_link_args = ['-fPIC', '-lstdc++']

if system_sass:
flags = [
'-fPIC', '-std=gnu++0x', '-Wall', '-Wno-parentheses', '-Werror=switch',
]
_maybe_clang(flags)
_maybe_macos(flags)

if platform.system() == 'FreeBSD':
link_flags = ['-fPIC', '-lc++']
else:
link_flags = ['-fPIC', '-lstdc++']
libraries = ['sass']
include_dirs = []
extra_compile_args = flags
extra_link_args = link_flags
else:
LIBSASS_SOURCE_DIR = os.path.join('libsass', 'src')

Expand Down Expand Up @@ -136,7 +138,6 @@ def _maybe_macos(flags):
msvc9compiler.get_build_version = lambda: 14.0
msvc9compiler.VERSION = 14.0
flags = ['/Od', '/EHsc', '/MT']
link_flags = []
else:
flags = [
'-fPIC', '-std=gnu++0x', '-Wall',
Expand Down Expand Up @@ -172,23 +173,17 @@ def restore_cencode():
with open(cencode_path, 'w') as f:
f.write(cencode_body)

if platform.system() == 'FreeBSD':
link_flags = ['-fPIC', '-lc++']
else:
link_flags = ['-fPIC', '-lstdc++']

libraries = []
include_dirs = [os.path.join('.', 'libsass', 'include')]
extra_compile_args = flags + [version_define]
extra_link_args = link_flags

sass_extension = Extension(
'_sass',
sorted(sources),
include_dirs=include_dirs,
depends=headers,
extra_compile_args=extra_compile_args,
extra_link_args=link_flags,
extra_link_args=extra_link_args,
libraries=libraries,
)

Expand Down