summaryrefslogtreecommitdiff
path: root/xattr/lib_build.py
blob: bb0caae52f830af155e41995bd6cd9c88e061fd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys
import os
from cffi import FFI

PATH = os.path.dirname(__file__)

with open(os.path.join(PATH, 'lib_build.h')) as hf:
    c_header = hf.read()
with open(os.path.join(PATH, 'lib_build.c')) as cf:
    c_source = cf.read()

ffi = FFI()
ffi.cdef(c_header)
ffi.set_source('_lib', c_source)

if __name__ == '__main__':
    ffi.compile()