Skip to content

Commit

Permalink
feat: serialization debug utility (#126)
Browse files Browse the repository at this point in the history
* feat: serialize canary

* bump bb

* feat: pass along asan settings

* Revert "bump bb"

This reverts commit 514682d.

* feat: pass build type to cmake
  • Loading branch information
ludamad authored and dbanks12 committed Mar 29, 2023
1 parent 31d6324 commit 53fed53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ option(MULTITHREADING "Enable multi-threading" ON)
option(TESTING "Build tests" ON)
option(ENABLE_ASAN "Address sanitizer for debugging tricky memory corruption" OFF)
option(BENCHMARKS "Build benchmarks" ON)
option(SERIALIZE_CANARY "Enable serialization checks" OFF)
option(FUZZING "Build fuzzing harnesses" OFF)
option(DISABLE_TBB "Intel Thread Building Blocks" ON)
option(COVERAGE "Enable collecting coverage from tests" OFF)
Expand All @@ -43,6 +44,10 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "a
set(DISABLE_TBB 0)
endif()

if(SERIALIZE_CANARY)
add_definitions(-DENABLE_SERIALIZE_CANARY)
endif()

if(FUZZING)
add_definitions(-DFUZZING=1)

Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake/barretenberg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ExternalProject_Add(Barretenberg
BUILD_ALWAYS TRUE
UPDATE_COMMAND ""
INSTALL_COMMAND ""
CONFIGURE_COMMAND ${CMAKE_COMMAND} --preset ${CMAKE_BBERG_PRESET}
CONFIGURE_COMMAND ${CMAKE_COMMAND} --preset ${CMAKE_BBERG_PRESET} -DSERIALIZE_CANARY=${SERIALIZE_CANARY} -DENABLE_ASAN=${ENABLE_ASAN} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
BUILD_COMMAND ${CMAKE_COMMAND} --build --preset ${CMAKE_BBERG_PRESET} --target barretenberg --target env
# byproducts needed by ninja generator (not needed by make)
BUILD_BYPRODUCTS ${BBERG_BUILD_DIR}/lib/libbarretenberg.a ${BBERG_BUILD_DIR}/lib/libenv.a)
Expand Down

0 comments on commit 53fed53

Please sign in to comment.