build_wasm.sh 709 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. #!/bin/bash
  4. export CC=/opt/wasi-sdk/bin/clang
  5. export CXX=/opt/wasi-sdk/bin/clang++
  6. if [ -d /mnt/build ];then
  7. rm -fr /mnt/build
  8. fi
  9. mkdir -p /mnt/build
  10. cd /mnt/build/
  11. echo "========> compile wasm with wasi-sdk"
  12. cmake ../.wamr && make
  13. echo && echo
  14. echo "========> compile wasm to AoT with wamrc"
  15. # target name will be provided:
  16. # - user input the target name in IDE
  17. # - generated wasm binary name will be set as user's input target name
  18. # - aot binary name should be the same as wasm binary name
  19. # - target name will be provided through 1st parameter
  20. wamrc -o $1.aot $1.wasm