Skip to content

Commit

Permalink
Enable auto install wasi-sdk when build wamr-sdk (#796)
Browse files Browse the repository at this point in the history
And fix -q[<App Name>] show error in host_tool help.
  • Loading branch information
wenyongh authored Oct 22, 2021
1 parent 3224298 commit 6b3a939
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test-tools/host-tool/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static void showUsage()
" [--watchdog=<Watchdog Interval>]\n"
" [<Control Options> ...] \n");
printf(" host_tool -u <App Name> [<Control Options> ...]\n");
printf(" host_tool -q [<App Name>] [<Control Options> ...]\n");
printf(" host_tool -q[<App Name>] [<Control Options> ...]\n");
printf(" host_tool -r <Resource URL> -A <Action> [-p <Payload File>] [<Control Options> ...]\n");
printf(" host_tool -s <Event URLs> [<Control Options> ...]\n");
printf(" host_tool -d <Event URLs> [<Control Options> ...]\n");
Expand Down
19 changes: 10 additions & 9 deletions wamr-sdk/build_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ done


if [ ! -f "/opt/wasi-sdk/bin/clang" ]; then
echo "Can't find wasi-sdk under /opt/wasi-sdk"
echo "You can download wasi-sdk from here:"
echo ""
echo "https://github.com/CraneStation/wasi-sdk/releases/tag/wasi-sdk-7"
echo ""
echo "please install it to the default path for your convenience"
echo ""
exit 1
echo "Intall wasi-sdk.." &&
rm -fr wasi-sdk-* /opt/wasi-sdk &&
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz &&
tar -zxf wasi-sdk-12.0-linux.tar.gz &&
mv wasi-sdk-12.0 /opt/wasi-sdk &&
rm -f wasi-sdk-12.0-linux.tar.gz
fi


Expand Down Expand Up @@ -190,7 +188,10 @@ if [ -n "$out" ]; then
fi
if [ "${LIBC_SUPPORT}" = "WASI" ]; then
echo "using wasi toolchain"
cmake .. $CM_DEXTRA_SDK_INCLUDE_PATH -DWAMR_BUILD_SDK_PROFILE=${PROFILE} -DCONFIG_PATH=${wamr_config_cmake_file} -DCMAKE_TOOLCHAIN_FILE=../wasi_toolchain.cmake
cmake .. $CM_DEXTRA_SDK_INCLUDE_PATH \
-DWAMR_BUILD_SDK_PROFILE=${PROFILE} \
-DCONFIG_PATH=${wamr_config_cmake_file} \
-DCMAKE_TOOLCHAIN_FILE=../wasi_toolchain.cmake
else
echo "using builtin libc toolchain"
cmake .. $CM_DEXTRA_SDK_INCLUDE_PATH \
Expand Down

0 comments on commit 6b3a939

Please sign in to comment.