-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
27 lines (23 loc) · 857 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
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os, shutil
files = ['dtb.so','python/dtb.so','python/dtb.cpp']
#clean up
for file in files:
if os.path.exists(file):
os.remove(file)
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [
Extension("dtb",
["python/dtb.pyx","src/analyzer.cpp","src/protocol.cpp","src/datastream.cpp","src/pixel_dtb.cpp","src/rpc.cpp","src/rpc_error.cpp","src/profiler.cpp","src/rpc_calls.cpp","src/rpc_io.cpp","src/USBInterface.libftd2xx.cc"],
include_dirs=["src","/usr/local/include"],
language="c++",
libraries=["ftd2xx"]
),
])
try:
shutil.copy('dtb.so','python/dtb.so')
except:
print 'Error: no shared object was generated!'