Fix wamrapi python binding for darwin (#1978)

This commit is contained in:
YAMAMOTO Takashi 2023-02-21 19:35:15 +09:00 committed by GitHub
parent 91eafa1ead
commit d8c333f32c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1782 deletions

View File

@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools>=42"]
requires = ["setuptools>=42", "ctypesgen==1.1.1"]
build-backend = "setuptools.build_meta"

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,8 @@
CUR_DIR=$(cd $(dirname $0) && pwd -P)
ROOT_DIR=${CUR_DIR}/../../..
WAMR_BUILD_PLATFORM=${WAMR_BUILD_PLATFORM:-"linux"}
UNAME=$(uname -s|tr A-Z a-z)
WAMR_BUILD_PLATFORM=${WAMR_BUILD_PLATFORM:-${UNAME}}
cd ${ROOT_DIR}/product-mini/platforms/${WAMR_BUILD_PLATFORM}
@ -14,4 +15,18 @@ mkdir -p build && cd build
cmake ..
make -j
cp libiwasm.so ${CUR_DIR}/../src/wamr/libs
case ${UNAME} in
darwin)
LIBNAME=libiwasm.dylib
;;
*)
LIBNAME=libiwasm.so
;;
esac
cp ${LIBNAME} ${CUR_DIR}/../src/wamr/libs
cd ${ROOT_DIR}/language-bindings/python/src/wamr/wamrapi
ctypesgen \
${ROOT_DIR}/core/iwasm/include/wasm_export.h \
-l ../libs/${LIBNAME} \
-o iwasm.py