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/
For details on how to create your first contract follow the Hello World Contract guide.
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 .. make
- Verify 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.