-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
40 lines (34 loc) · 1.02 KB
/
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
#!/usr/bin/env python
import platform
from Cython.Build import cythonize
from setuptools import Extension, setup
ext_modules = cythonize(
[
Extension(
"flatrtree.box_dist",
["src/flatrtree/box_dist.pyx"],
language="c",
extra_compile_args=["-O3"],
),
Extension(
"flatrtree.hilbert_builder",
["src/flatrtree/hilbert_builder.pyx"],
language="c++",
extra_compile_args=["-O3"],
),
Extension(
"flatrtree.omt_builder",
sources=["src/flatrtree/omt_builder.pyx"],
language="c++",
extra_compile_args=["-O3", "-std=c++11"],
),
],
compiler_directives={"language_level": 3},
)
if platform.python_implementation() == "CPython":
# Only run mypyc on CPython, not PyPy, etc.
from mypyc.build import mypycify
ext_modules += mypycify(
["src/flatrtree/rtree.py", "src/flatrtree/serialization.py"]
)
setup(ext_modules=ext_modules)