diff --git a/setup.py b/setup.py index 11d73c0b..76a5c40a 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,11 @@ # Link against libm (math library) for functions like log10() LDFLAGS.extend(['-lm']) +if platform.uname().system == 'FreeBSD': + # Cython's thread-safe module state lookup uses the C11 threads API on + # CPython 3.12+. FreeBSD provides that API in libstdthreads. + LDFLAGS.extend(['-lstdthreads']) + _ROOT = pathlib.Path(__file__).parent