Skip to content

Commit

Permalink
Version print added to the proof generators.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaskov committed Jan 11, 2024
1 parent 9ea340e commit 7fcc549
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bin/proof-generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ include(CMSetupVersion)

cm_project(proof-generator-${PROOF_GENERATOR_MODE_SUFFIX} WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES ASM C CXX)

if (CPACK_PACKAGE_VERSION)
add_compile_definitions(PROOF_GENERATOR_VERSION=${CPACK_PACKAGE_VERSION})
endif()

string(TOUPPER ${PROOF_GENERATOR_MODE_SUFFIX} PROOF_GENERATOR_MODE_SUFFIX)
string(REPLACE "-" "_" PROOF_GENERATOR_MODE_SUFFIX ${PROOF_GENERATOR_MODE_SUFFIX})

Expand Down
13 changes: 12 additions & 1 deletion bin/proof-generator/src/aspects/prover_vanilla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ namespace nil {
}

void prover_vanilla::initialize(configuration_type &vm) {
if (vm.count("version")) {
#ifdef PROOF_GENERATOR_VERSION
std::cout << PROOF_GENERATOR_VERSION << std::endl;
#define xstr(s) str(s)
#define str(s) #s
std::cout << xstr(PROOF2JSON_VERSION) << std::endl;
#else
std::cout << "undefined" << std::endl;
#endif
}

std::string log_level = "info";

if (vm.count("log-level")) {
Expand All @@ -80,7 +91,7 @@ namespace nil {
};

if (log_options.find(log_level) == log_options.end()) {
std::cerr << "Invalid command line argument -l (log level): " << log_level << std::endl;
BOOST_LOG_TRIVIAL(error) << "Invalid command line argument -l (log level): " << log_level << std::endl;
return;
}

Expand Down

0 comments on commit 7fcc549

Please sign in to comment.