File size: 919 Bytes
065fee7 |
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 45 |
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()
|