目次
導入手順
前提としてVisual Studioの2015以降、CMakeが必要です。
Cloning

git clone --recursive https://github.com/WebAssembly/wabt

cd wabt
git submodule update --init
Building (Windows)
wabtディレクトリ下にbuildディレクトリを作成し移動します。

mkdir build
cd build
Visual studio installerから”C++によるデスクトップ開発”にチェックを入れて変更します。
Visual studio のバージョンを確認


cmake -help
プロジェクトのビルド


cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=..\ -G "Visual Studio 17 2022"
cmake --build . --config DEBUG --target install
PATHをシステム変数に追加する

C:\wabt\bin
任意の場所からヘルプ等でインストールを確認

トラブルシューティング
The C Compiler identification is unknown
remove the CMakeCache.txt
- CMake Error: Could not create named generator Visual Studio xx xxxx
- Does not match the generator used previously: Visual Studio xx xxxx
ジェネレータの指定ミス>異なる指定のキャッシュが残る事で発生します。
buildディレクトリ上でキャッシュを削除します。
rm CMakeCache.txt
参考
GitHub - WebAssembly/wabt: The WebAssembly Binary Toolkit
The WebAssembly Binary Toolkit. Contribute to WebAssembly/wabt development by creating an account on GitHub.