def get_cython_extensions():
files = ["capnpy/segment/base.pyx",
"capnpy/segment/segment.py",
"capnpy/segment/builder.pyx",
"capnpy/blob.py",
"capnpy/enum.py",
"capnpy/visit.py",
"capnpy/struct_.py",
"capnpy/list.py",
"capnpy/type.py",
"capnpy/message.py",
"capnpy/buffered.py",
"capnpy/filelike.py",
"capnpy/ptr.pyx",
"capnpy/packing.pyx",
"capnpy/_hash.pyx",
"capnpy/_util.pyx"
]
root_dir = os.path.abspath(os.path.dirname(__file__))
capnpy_dir = os.path.join(root_dir, 'capnpy')
def getext(fname):
extname = fname.replace('/', '.').replace('.pyx', '').replace('.py', '')
if DEBUG:
extra_compile_args = ['-O0', '-g']
else:
extra_compile_args = ['-O3']
return Extension(
extname,
[fname],
include_dirs = [capnpy_dir],
extra_compile_args = extra_compile_args,
)
return [getext(f) for f in files]
评论列表
文章目录