diff --git a/README.md b/README.md index e8687d41..d7c9278d 100644 --- a/README.md +++ b/README.md @@ -286,6 +286,11 @@ To compile and run the tests for this library, run: $ make check +To compile and run the gadgetlib2 tutorial, run: + + $ make gadgetlib2_tutorial + $ ./libsnark/gadgetlib2_tutorial + ### Using libsnark as a library To develop an application that uses libsnark, it's recommended to use your own build system that incorporates libsnark and dependencies. If you're using CMake, add libsnark as a git submodule, and then add it as a subdirectory. Then, add `snark` as a library dependency to the appropriate rules. diff --git a/libsnark/CMakeLists.txt b/libsnark/CMakeLists.txt index 2e127940..562fcf2a 100644 --- a/libsnark/CMakeLists.txt +++ b/libsnark/CMakeLists.txt @@ -472,6 +472,21 @@ target_link_libraries( gtest_main ) +add_executable( + gadgetlib2_tutorial + EXCLUDE_FROM_ALL + + gadgetlib2/examples/tutorial.cpp + gadgetlib2/examples/simple_example.cpp + gadgetlib2/examples/simple_example.hpp +) +target_link_libraries( + gadgetlib2_tutorial + + snark + gtest_main +) + add_executable( relations_qap_test EXCLUDE_FROM_ALL