-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
51 lines (45 loc) · 1.38 KB
/
setup.py
File metadata and controls
51 lines (45 loc) · 1.38 KB
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
46
47
48
49
50
51
"""Build Python extension."""
import os
from glob import glob
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
def main():
"""Python extension build entrypoint."""
os.environ["CC"] = "ibm-clang64"
os.environ["CFLAGS"] = "-std=c11"
os.environ["CXX"] = "ibm-clang++64"
os.environ["CXXFLAGS"] = "-std=c++17"
setup_args = {
"ext_modules": [
Extension(
"cbxp._C",
sources=(
glob("cbxp/**/*.cpp")
+ [file for file in glob("cbxp/*.cpp") if file != "cbxp/main.cpp"]
+ ["cbxp/python/_cbxp.c"]
),
include_dirs=(
glob("cbxp/**/")
+ [
"cbxp",
"externals",
"/usr/include/zos",
]
),
extra_link_args=[
"-m64",
"-Wl,-b,edit=no",
],
extra_compile_args=[
"-O2",
"-fzos-le-char-mode=ascii",
"-fstack-protector-strong",
"-Wno-trigraphs",
],
),
],
"cmdclass": {"build_ext": build_ext},
}
setup(**setup_args)
if __name__ == "__main__":
main()