How to compile a smart contract with CMake
Overview
This guide provides instructions to compile a smart contract with CMake.
Before you begin
- You have the source of the contract saved in a local folder, e.g.
./examples/hello/
Procedure
Follow the following steps to compile your contract.
Navigate to the hello folder in examples (./examples/hello), you should then see the ./src/hello.cpp file
Run following commands:
mkdir build
cd build
cmake ..
makeVerify the following two files were generated:
- the compiled binary wasm:
hello.wasm
, - and the generated ABI file:
hello.abi
.
Summary
In conclusion, the above instructions show how to compile a smart contract with CMake.