Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bb): add bb --version command #2482

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions barretenberg/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ project(
VERSION 0.7.10 # x-release-please-version
LANGUAGES CXX C
)
# Insert version into `bb` config file
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/barretenberg/bb/config.hpp.in
${CMAKE_CURRENT_SOURCE_DIR}/src/barretenberg/bb/config.hpp
@ONLY
)


option(DISABLE_ASM "Disable custom assembly" OFF)
option(DISABLE_ADX "Disable ADX assembly variant" OFF)
Expand Down
1 change: 1 addition & 0 deletions barretenberg/cpp/src/barretenberg/bb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.hpp
6 changes: 6 additions & 0 deletions barretenberg/cpp/src/barretenberg/bb/config.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef INCLUDE_GUARD
#define INCLUDE_GUARD

#define BB_VERSION "@CMAKE_PROJECT_VERSION@"

#endif // INCLUDE_GUARD
6 changes: 5 additions & 1 deletion barretenberg/cpp/src/barretenberg/bb/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.hpp"
#include "get_bytecode.hpp"
#include "get_crs.hpp"
#include "get_witness.hpp"
Expand Down Expand Up @@ -334,7 +335,10 @@ int main(int argc, char* argv[])
bool recursive = flagPresent(args, "-r") || flagPresent(args, "--recursive");

// Skip CRS initialization for any command which doesn't require the CRS.
if (command == "info") {
if (command == "--version") {
writeStringToStdout(BB_VERSION);
return 0;
} else if (command == "info") {
std::string output_path = getOption(args, "-o", "info.json");
acvmInfo(output_path);
return 0;
Expand Down