This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from elmato/update-readme-wasm-toolchain
Instructions to perform a full build with the WASM toolchain
- Loading branch information
Showing
1 changed file
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,11 +112,26 @@ Done | |
By default LLVM and clang do not include the WASM build target, so you will have to build it yourself. Note that following these instructions will create a version of LLVM that can only build WASM targets. | ||
|
||
``` | ||
git clone --depth 1 --single-branch --branch release_40 [email protected]:llvm-mirror/llvm.git | ||
mkdir ~/wasm-compiler | ||
cd ~/wasm-compiler | ||
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git | ||
cd llvm/tools | ||
git clone --depth 1 --single-branch --branch release_40 [email protected]:llvm-mirror/clang.git | ||
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git | ||
cd .. | ||
mkdir build | ||
cd build | ||
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=.. -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../ | ||
make -j4 install | ||
``` | ||
|
||
### Using the WASM compiler to perform a full build of the project | ||
|
||
The WASM_LLVM_CONFIG environment variable is used to find our recently built WASM compiler. | ||
This is needed to compile the example contracts insde eos/contracts folder and their respective tests. | ||
|
||
``` | ||
git clone https://github.com/eosio/eos --recursive | ||
mkdir -p eos/build && cd eos/build | ||
WASM_LLVM_CONFIG=~/wasm-compiler/llvm/bin/llvm-config cmake .. | ||
make -j4 | ||
``` |