-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
23 lines (19 loc) · 710 Bytes
/
Copy pathsetup.py
File metadata and controls
23 lines (19 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import sys
from setuptools import Extension, setup
# Builds the futex-based extension on Linux only when explicitly enabled
# My tests show that it brings no practical performance value and is more brittle.
extensions = []
if sys.platform.startswith("linux") and os.environ.get("USE_FUTEX"):
extensions.append(
Extension(
name="shm_rpc_bridge.transport.linux_futex",
sources=["src/shm_rpc_bridge/transport/linux_futex.c"],
define_macros=[("_GNU_SOURCE", "1")],
extra_compile_args=["-O3", "-std=c11", "-Wall", "-Wextra"],
)
)
# setuptools will read most configuration from pyproject.toml
setup(
ext_modules=extensions,
)