-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
39 lines (34 loc) · 779 Bytes
/
setup.py
File metadata and controls
39 lines (34 loc) · 779 Bytes
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
import os
import sysconfig
from setuptools import Extension, setup
DEBUG = int(os.environ.get("CONS_DEBUG", 0)) == 1
DEBUG_LEVEL = 0
# Common flags for both release and debug builds.
extra_compile_args = sysconfig.get_config_var("CFLAGS").split()
extra_compile_args += [
"-Wall",
"-Wextra",
"-Wno-unused-parameter",
"-Wconversion",
"-Wsign-conversion",
"--std=c11",
]
if DEBUG:
extra_compile_args += [
"-g3",
"-O0",
f"-DDEBUG={DEBUG_LEVEL}",
"-UNDEBUG",
"-fanalyzer",
]
else:
extra_compile_args += ["-DNDEBUG", "-O3"]
setup(
ext_modules=[
Extension(
name="fastcons",
sources=["consmodule.c"],
extra_compile_args=extra_compile_args,
)
]
)