-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
20 lines (17 loc) · 865 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# DO NOT reorder these imports due to monkey-patch
from pybind11.setup_helpers import Pybind11Extension
from distutils.core import setup, Extension
import subprocess
cpython_mod = Extension('sum_from_cpython', sources=['src/sum_cpython.c'])
pybind_mod = Pybind11Extension('sum_from_pybind11',
sources=['src/sum_pybind11.cpp'])
subprocess.run(["swig", "-outcurrentdir", "-python", "src/swig_sum.i"])
swig_mod = Pybind11Extension('_swig_example',
sources=['swig_sum_wrap.c', 'src/sum.c'])
pybind_demo_mod = Pybind11Extension('pybind11_demo',
sources=['src/pybind11_demo.cpp'])
setup(name='demo',
version='0.0',
description='This is a demo package',
ext_modules=[cpython_mod, pybind_mod, swig_mod, pybind_demo_mod],
py_modules=['swig_example'])