-
Notifications
You must be signed in to change notification settings - Fork 21
/
setup.py
33 lines (29 loc) · 871 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
import os
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup
include_dirs = [
"tactics2d/math/cpp_function/include",
]
if os.name == "nt": # Windows
extra_compile_args = ["/O2"]
else: # Linux, MacOS
extra_compile_args = ["-O3"]
ext_modules = [
Pybind11Extension(
"cpp_function",
[
"tactics2d/math/cpp_function/src/b_spline.cpp",
"tactics2d/math/cpp_function/src/cubic_spline.cpp",
"tactics2d/math/cpp_function/src/bezier.cpp",
"tactics2d/math/cpp_function/src/circle.cpp",
"tactics2d/math/cpp_function/src/pybind11_bindings.cpp",
],
include_dirs=include_dirs,
language="c++",
extra_compile_args=extra_compile_args,
),
]
setup(
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
)