-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
executable file
·51 lines (41 loc) · 985 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
45
46
47
48
49
50
#!/usr/bin/env python
import os
import setuptools
import sys
class NumpyImport:
def __repr__(self):
import numpy as np
return np.get_include()
__fspath__ = __repr__
# NOTE: If zmesh.cpp does not exist, you must run
# cython --cplus -I./zi_lib/ zmesh.pyx
extra_compile_args = []
if sys.platform == 'win32':
extra_compile_args += [
'/std:c++17', '/O2'
]
else:
extra_compile_args += [
'-std=c++17', '-O3', '-Wno-unused-local-typedefs',
'-DNDEBUG',
]
include_dirs = [ str(NumpyImport()), 'zi_lib/', './' ]
setuptools.setup(
setup_requires=['pbr', 'numpy', 'cython'],
python_requires=">=3.8",
pbr=True,
define_macros=[ ("NDEBUG", 1) ],
extras_require={
"viewer": [ "vtk" ],
},
ext_modules=[
setuptools.Extension(
'zmesh._zmesh',
sources=[ 'zmesh/_zmesh.pyx' ],
depends=[ 'zmesh/cMesher.hpp' ],
language='c++',
include_dirs=include_dirs,
extra_compile_args=extra_compile_args
),
],
)