pyebur128/setup.py

40 lines
1.2 KiB
Python
Raw Normal View History

2021-03-21 23:37:47 +00:00
#!/usr/bin/python3
2024-09-03 18:49:34 +00:00
from setuptools import setup, Extension
2021-03-21 23:37:47 +00:00
extensions = [
Extension(
name='pyebur128.pyebur128',
sources=[
"src/pyebur128/pyebur128.pyx",
"src/lib/ebur128/ebur128.c",
],
include_dirs=[
'.',
'src/lib/ebur128',
'src/lib/ebur128/queue',
],
2024-09-03 18:49:34 +00:00
# Not happy about it, but I'll just use this macro on all compilers for
# now. Setuptools doesn't have a reliable way to detect MSVC when they
# started deprecating the older distutils functionality of MSVCCompiler
# and new_compiler(). Besides, looking at the old distutils code, it
# just assumed that MSVC was the compiler if it detected Windows. If you
# wanted GCC/MinGW/LLVM on Windows, you had to manually pass it as an
# argument to new_compiler().
# See https://github.com/pypa/setuptools/issues/2806
define_macros=[('_USE_MATH_DEFINES', None)],
2021-03-21 23:37:47 +00:00
),
]
if __name__ == '__main__':
from Cython.Build import cythonize
setup(
ext_modules=cythonize(
extensions,
compiler_directives={'language_level': 3, 'embedsignature': True},
),
)