create_lib.sh 853 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. CUR_DIR=$(cd $(dirname $0) && pwd -P)
  5. ROOT_DIR=${CUR_DIR}/../../..
  6. UNAME=$(uname -s|tr A-Z a-z)
  7. WAMR_BUILD_PLATFORM=${WAMR_BUILD_PLATFORM:-${UNAME}}
  8. cd ${ROOT_DIR}/product-mini/platforms/${WAMR_BUILD_PLATFORM}
  9. mkdir -p build && cd build
  10. cmake \
  11. -DWAMR_BUILD_DEBUG_INTERP=1 \
  12. -DWAMR_BUILD_LIB_PTHREAD=1 \
  13. -DWAMR_BUILD_LIB_WASI_THREADS=1 \
  14. -DWAMR_BUILD_LIB_WASI=1 \
  15. -DBUILD_SHARED_LIBS=ON \
  16. ..
  17. make -j
  18. case ${UNAME} in
  19. darwin)
  20. LIBNAME=libiwasm.dylib
  21. ;;
  22. *)
  23. LIBNAME=libiwasm.so
  24. ;;
  25. esac
  26. cp ${LIBNAME} ${CUR_DIR}/../src/wamr/libs
  27. cd ${ROOT_DIR}/language-bindings/python/src/wamr/wamrapi
  28. ctypesgen \
  29. ${ROOT_DIR}/core/iwasm/include/wasm_export.h \
  30. -l ../libs/${LIBNAME} \
  31. -o iwasm.py