This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/test-tools/wamr-ide/WASM-Toolchain/Docker/resource/build_wasm.sh
Wang Ning 653b926d53
Upgrade WAMR-IDE (#1313)
Upgrade WAMR-IDE: test-tools/wamr-ide folder
- add `wamr-sdk` to include libc-builtin-sysroot header files
- add `prettier` check and apply script in `package.json`
- update `wasm-toolchain` dockerfile and resource
- enhance `build | run | debug` process to clean up the container
- enhance the change workspace
- enhance `wasm` type project check before building, running and debugging
- format the project_compilation.json
- update documents
2022-07-29 08:12:36 +08:00

25 lines
816 B
Bash
Executable File

# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#!/bin/bash
export CC=/opt/wasi-sdk/bin/clang
export CXX=/opt/wasi-sdk/bin/clang++
cd /mnt
if [ -d build ];then
rm -fr build
fi
mkdir -p build && cd build
echo "========> compile wasm with wasi-sdk"
cmake -DWASI_SDK_DIR=/opt/wasi-sdk -DCMAKE_TOOLCHAIN_FILE=/opt/wamr-sdk/app/wamr_toolchain.cmake ../.wamr && make
if [ $? -eq 0 ]; then
echo "========> compile wasm to AoT with wamrc"
# target name will be provided:
# - user input the target name in IDE
# - generated wasm binary name will be set as user's input target name
# - aot binary name should be the same as wasm binary name
# - target name will be provided through 1st parameter
wamrc -o $1.aot $1.wasm
fi