This guide provides instructions to compile a smart contract with CMake.
- 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.
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:
- and the generated ABI file:
In conclusion, the above instructions show how to compile a smart contract with CMake.