-
-
Notifications
You must be signed in to change notification settings - Fork 101
/
setup.py
44 lines (37 loc) · 919 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
import platform
import sys
from setuptools import Extension, setup
NO_EXTENSIONS = bool(os.environ.get("MULTIDICT_NO_EXTENSIONS"))
if sys.implementation.name != "cpython":
NO_EXTENSIONS = True
CFLAGS = ["-O2"]
# CFLAGS = ['-g']
if platform.system() != "Windows":
CFLAGS.extend(
[
"-std=c99",
"-Wall",
"-Wsign-compare",
"-Wconversion",
"-fno-strict-aliasing",
"-pedantic",
]
)
extensions = [
Extension(
"multidict._multidict",
["multidict/_multidict.c"],
extra_compile_args=CFLAGS,
),
]
if not NO_EXTENSIONS:
print("*********************")
print("* Accelerated build *")
print("*********************")
setup(ext_modules=extensions)
else:
print("*********************")
print("* Pure Python build *")
print("*********************")
setup()