From ac7b3f989510682856eae226dc1d92aff9116f31 Mon Sep 17 00:00:00 2001 From: Dan Middleton Date: Tue, 27 Mar 2018 17:26:38 -0500 Subject: [PATCH] Add build target for gadgetlib2 tutorial From build directory: cmake .. make gadgetlib2_tutorial Run resulting binary: ./libsnark/gadgetlib2_tutorial Signed-off-by: Dan Middleton --- README.md | 5 +++++ libsnark/CMakeLists.txt | 15 +++++++++++++++ 2 files changed, 20 insertions(+) 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