fix Python build

This commit is contained in:
Hubert Chathi 2021-06-17 11:55:16 -04:00
parent 9a8b421903
commit 2aad86ea84
3 changed files with 9 additions and 3 deletions

View file

@ -1,7 +1,7 @@
all: olm-python2 olm-python3
OLM_HEADERS = ../include/olm/olm.h ../include/olm/inbound_group_session.h \
../include/olm/outbound_group_session.h \
../include/olm/outbound_group_session.h
include/olm/olm.h: $(OLM_HEADERS)
mkdir -p include/olm
@ -10,12 +10,15 @@ include/olm/olm.h: $(OLM_HEADERS)
echo 'void *memset(void *s, int c, size_t n);' >> include/olm/olm.h
include/olm/pk.h: include/olm/olm.h ../include/olm/pk.h
$(CPP) -I dummy -I ../include -o include/olm/pk.h ../include/olm/pk.h
$(CPP) -I dummy -I ../include -o include/olm/pk.h ../include/olm/pk.h
include/olm/sas.h: include/olm/olm.h ../include/olm/sas.h
$(CPP) -I dummy -I ../include -o include/olm/sas.h ../include/olm/sas.h
headers: include/olm/olm.h include/olm/pk.h include/olm/sas.h
include/olm/error.h: include/olm/olm.h ../include/olm/error.h
$(CPP) -I dummy -I ../include -o include/olm/error.h ../include/olm/error.h
headers: include/olm/olm.h include/olm/pk.h include/olm/sas.h include/olm/error.h
olm-python2: headers
DEVELOP=$(DEVELOP) python2 setup.py build

0
python/dummy/olm/error.h Normal file
View file

View file

@ -49,6 +49,9 @@ ffibuilder.set_source(
extra_compile_args=compile_args,
extra_link_args=link_args)
with open(os.path.join(PATH, "include/olm/error.h")) as f:
ffibuilder.cdef(f.read(), override=True)
with open(os.path.join(PATH, "include/olm/olm.h")) as f:
ffibuilder.cdef(f.read(), override=True)